Once you’e acquired the first seven Gym Badges, go back to the Viridian City Gym, located near the north-east corner of Viridian City. As you try to enter, your rival will arrive on the scene. He’ll ask you where to go next. Well, maybe you could try asking Professor Oak.
Back at Oak’s Lab, you’ll bump into Blue, who also happens to be Oak’s grandson. As thanks, he’ll give you a Keystone, plus the Mega Stones for the three original starters. With these, you can Mega Evolve Venusaur, Charizard and Blastoise during battles.
Afterwards, exit the lab. You’ll bump into the girl from outside. She’ll casually mention that the Viridian City Gym is now open. That’s… awfully convenient timing, in every sense. Anyway, head back to the Viridian City Gym and open the door.