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.
If you have the Keystone and a matching Mega Stone, during battles, you can trigger Mega Evolution by selecting the icon to the left of your Pokémon's moves. Your Pokémon will then Mega Evolve as the next Turn begins and use their move when its their turn.
Mega Evolution greatly boosts a Pokémon's stats. However, you can only Mega Evolve once per battle. Also, a Mega Evolved Pokémon will return to normal after the battle ends or if it's been KO'd. Charizard and Mewtwo can Mega Evolve into two forms.
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.