The Spider Mastermind has several attacks:
Swipe: Happens only when you're close to it.
Plasma Rifle: The same attack Possessed Soldiers use. Dodge it by moving to the side.
Laser Beams: Three laser beams on its left and right sides are fired, plus one from the front. Jump over the low beam, duck for the higher ones.
Electric Gas: The boss releases gas in the entire area. Hop onto one of the platforms that emerge and hit the Spider's brains with Rockets or the Gauss Cannon, then quickly hop off the platform before it explodes or ejects spikes.
Spike Block Throw: Near the end of the fight, the Spider Mastermind collapses and will throw with telekinetic powers spikey rocks at you. Shoot these in time to avoid damage and keep firing at the Spider's brains.
Always target the Spider's brains, use the BFG to stun it and then fire the Gauss Cannon at its brains. Pick up collectibles from it and destroyed pillars.