I'm afraid Woonderwaffle's answer was only partially correct. Scrappy has no effect on ground attacks. If you were playing a game before generation III, there are no abilities, so Gastly would indeed be weak to ground. It could also be caused by gravity, smack down, ingrain, thousand arrows, entrainment, skill swap, gastro acid, worry seed, simple beam, or holding an iron ball.