The trick is to die right before the boss of stage 1 (the huge red boss that looks like something H. R. Giger did for Aliens) dies. There are a few ways to do this, but this is the method I find easiest to time. It takes two powered-up hits directly to the head coming out of the boss's stomach to kill the boss. This is slightly harder to do than the usual method of killing it (sending the pod towards the head and then get out of the way) because you need to get close, past the tail, and fire right after the mouth fires. After the first shot, time the second so you'll be hit, say by the tail, immediately after you fire. You'll die, and a moment later your shot will hit the boss, killing it.
Here's the glitchy results of doing that. When you get your next ship you'll begin at the last continue point as you normally would. However, the music that signifies clearing a stage will play and you won't be able to control your ship, just like the first few seconds after finishing a stage. However, enemies will still be attacking you and you'll inevitably die.
Then when you get your next ship it'll seem like you're about to fight the boss of stage 2! In fact, the background will be that of stage 2, except it looks sort of like the negative of it. Sometimes the graphics are even more glitched up, and some tiles will flash or do other things - it's like the result of putting a dirty game into an NES. The enemy sprites are glitched up as well, and most don't look like anything. However, despite the graphics, this is STILL stage one. The enemy patterns are the same, and so are the positions of the walls - which means you'll need to be careful, as you can't see the walls! If your R-9's fire is stopped by something invisible, that means a wall is there. This glitch leads me to believe that hit detection in R-Type is based on tile boundaries rather than actual collision of pixels. The graphics remain glitched up even if you die or continue, but will go back to normal for stage 2 if you beat the stage one boss as usual (at which time the tiles of the boss become black on the screen rather than exploding as they're supposed to. It looks like what happens if Ryu loses his last life on the final boss - the demon - of Ninja Gaiden and the screen flashes).
Discovered by Crawl and 1000, taken with permission from Flying Omelette.