Here's what you do.
1. Before entering the first room, shoot though the entrance for a while. That way, when you enter, the first barrier will be gone.
2. Quickly take the upper path and stand on the edge of the barrier. That's right. It might not look like you can stand there, but you can.
3. When you enter the next section, immediately jump over the two "donuts" that come your way and shoot down the barrier, Before you enter this screen you might want to time your entrance so that one turret doesn't shoot you when you jump.
4. Hurry over to the fourth barrier and shoot it down. The "donuts" should be going towards the spot where the third barrier was instead of at you if you did it right.
5. Begin shooting Mother Brain. When the donuts respawn and begin to swarm you, WAIT FOR THE TURRET TO FIRE, then go back to the place where the third barrier was and continue to shoot. You may need to shoot one out of your way before getting on the platform.
6. At this point just continue to alternate between steps 4. and 5. jumping and shooting Mother Brain the entire time. Again, don't move in front of turret fire. By simply following the pattern, you'll beat the boss.