And now, you're truly at the final stage of the game. It's been a long trip, but this is where Dr. Wily finally gets his due. You'll appear in a room just left of where the battle appears, and an energy tank will be up on a ledge above. Use the Rush Jet to fly up and grab it. Also, check the contents of the canisters, as they sometimes contain energy tanks. Finally, refill your shadow blade and search snake. If this isn't possible, note that you should die all your lives and continue the stage fresh, with your meters charged, rather than wasting energy tanks on a lost cause.
Ready to go, then? Good. Step through the gate and prepare for the final battle.
Dr. Wily had talked about a peace-keeping robot, but it was only a ruse to get his associate to create a weapon of destruction. Now you get to fight that robot.
Fortunately, the battle is a lot simpler than you might anticipate. When it starts, run under the center portion of the robot. Directly above you, a robot should be perched, firing shots. They will arc almost directly down, so just move slightly left and right while making small hops and tossing shadow blades upward.
When half the robot's life meter is drained, a horned cap will descend. Dr. Wily is seated in a bubble within that cap, but it's vulnerable only to attacks from above. At this time, a spiked fist will come out from the right side of the screen. Jump to avoid the spikes, and land on the flat portion of the hand, above the spikes. From there, as the hand starts to recede, jump up to the set of blocks to the right.
From this series of blocks, you can jump outward and toss search snake shots. Move carefully. There shouldn't be any reason to fall down to the ground level again. Just hop outward from the block closest to Dr. Wily's bubble, toss a search snake or two, then land back on the edge of the block and repeat. You'll make short work of the remainder of the life meter, and then the screen will flash and you'll be watching the closing story sequence and game credits.