I'll put it simply. Gary is a pain. He'll taunt you constantly over the course of Fire Red and Leaf Green, whether you beat him in fights or not, and you'll want desperately to knock the little jerk out with a chair.
You can't, sadly. But you can trounce his teams of pokemon, which is usually pretty fun in and of itself. And here are the ways of doing that over the course of the game.
• First fight, Pallet Town
And, coincidentally, your first Pokemon battle. Gary will choose the pokemon type that's effective against yours, but in this case it doesn't matter as they don't have moves painful to your pokemon yet anyway. Just Tackle, Growl and Tail Whip him into submission. This is the only battle in the game you can lose and not white out.
• Second fight, Route 22
In addition to his starter. Gary will have picked up a Pidgey. Either get another pokemon of your own or level up to 13 or 14, as his pokemon are both level 9. An easy fight overall; just slug through his pokemon with brute force.
• Third fight, Route 24
A bit harder. Gary now has an Abra and a Rattata, and his Pidgey is now a Pidgeotto. Have four or five pokemon and engage in another brute force battle, matching up types as best you can. The starter, as ever, is the toughest obstacle, though Pidgeotto comes a close second.
• Fourth fight, Pokemon Tower
Gary's stepping up his training now and is a decent bit tougher. Abra's a Kadabra, Rattata is gone and depending on his starter Gary will have a combination of Guarados, Exeggcute or Growlithe on his team. His starter will also have evolved by one stage. Make sure your pokemon are close to level 30 and you won't have any problems. A good electric pokemon is a boon for this fight and subsequent, as Gary has two pokemon in every team combination weak to electric attacks.
• Fifth fight, Silph Co
Gary's team is quite powerful now, most in the mid to high 30s. The lineup won't have changed since the last fight though everything outside the Exeggcute and Growlithe will have evolved to their peak. Use basically the same strategies as before; as long as your pokemon are strong enough they should be fine.
• Sixth fight, Route 22
On your way to the Pokemon League you'll run into Gary again, and he's got the same team as ever, only this time he's tossed in a Rhyhorn to make for a complete set of six. A solid water pokemon to take it out is recommended, which you probably already had to deal with his fire types. Strong, but hardly unstoppable as long as you've been leveling consistently.
• Seventh fight, Pokemon League
Gary's the champion and you need to take him down. Rhyhorn is a Rhydon, Growlithe an Arcanine, Exeggcute and Exeggutor. The same rules apply as always, though his team is a lot stronger than it ever was before. A good combination of electric, water and strong normal attacks shoould do the trick overall: just be careful of Exeggutor if you have to face it, as it likes to inflict status ailments to mess up your team.
Thought that was the end of the game? Not quite. Gary comes back after you're finished in the Sevii Islands with a new team to mess you up, and they're the strongest team in the whole game.
• Eighth fight, Pokemon League
With his pokemon in the mid 70s consistently, Gary isn't screwing around. Pidgeot is gone in favor of a powerful Heracross, and Rhydon is replaced by a Tyranitar. The rest of the team is the same, just stronger. Heracross is a real pain, but will go down easy against a flying attack from a fast pokemon since it's bug and fighting. Tyranitar isa real nuisance thanks to sand stream whipping up a sandstorm, so either take it out fast with a water pokemon or toss in a ground type and try to take it down with earthquake.