On Cinnabar Island if you don't have the key to the gym with you there is a small glitch you can perform. First, use Surf on the right hand side of the island and move upwards until you're across from the door. Get off your Pokemon and walk until you're in front of the gym door where you'll get the message about it being locked. Look up and you'll see an old man on the roof while this text is displayed.
Contributed by Hexadecimal