Barrier Eggman (バリアエッグマン?) is a boss fight that appears in the Wing Fortress Zone of Sonic the Hedgehog 2 and the Flying Battery Zone of Sonic & Knuckles (as well as its locked-on form, Sonic the Hedgehog 3 & Knuckles).
In both cases, the fight involves the player trapped in a small room behind an impenetrable force-field-like barrier. Within the room is a moving laser that is operated by Dr. Robotnik from a control panel just on the other side of the barrier. Once the boss is defeated, the barrier fails, allowing the player to proceed, and Robotnik escapes.
Barrier Eggman is the boss of the Wing Fortress Zone in Sonic the Hedgehog 2.
In this version, the room is filled with spiked platforms that must be avoided. The boss is defeated by jumping on top of one of these platforms and then performing a Spin Attack on the exposed laser on the ceiling before it fires. The laser eye must be hit eight times in order to destroy it.
In this version, there are no more spiked platforms (meaning that the player cannot attack the laser eye directly). Instead, the room becomes smaller every time that the laser is fired. Eventually, so much of the room is damaged that the barrier falls on its own. To win this fight, the player only needs to avoid the laser fire for a certain number of times.
Though the player must avoid the laser to win the fight, it is possible to hit the laser eye, but it doesn't do anything.
The Sonic 2 version of this boss battle was featured in Sonic the Comic #6, "Attack on the Death Egg", in which Sonic returns to the Wing Fortress some time after the events of Sonic the Hedgehog 2 to find that the defenses have been left running on automatic. Having defeated the system before, he easily does so again by leaping onto a spiked platform and then hitting the laser cannon with a Spin Attack.