Like Bash already mentioned, you have to always deny the SPATK and DEF boosts to the pokemon an the battlefield as all boosts those pokemon collect will be added to the Mega-Gengar in the end. Thats the most important thing to keep in mind.
You do that by always having one if your pokemon on the SPATK and DEF boosting fields. If the opposing pokemon collected one of these boosts you are better off to surrender and start again as you wont be able to beat the Mega-Gengar in the end anyway.