Like was said, it is in the Thanos series.
A brief version is that Thanos goes to Earth and kills all the heroes. Punisher is left barely alive and says he will do anything to get back at Thanos. Mephisto hears and makes Castle Ghost Rider. This is a little strange but fine (given the different origins of GR it always gets strange, and there is a new Ghost Rider series starring Blaze, a little behind but I imagine Robbie is out there currently too. He beat the Starbrand last I saw).
Anyway, nobody was left alive to avenge and he was alone on Earth for a long time. Galactus shows up bleeding badly asking for help, particularly from Reed Richards. Frank tells Galactus that they are all dead and Galactus returns that everyplace else is not much better. Most of the great empires are dead or almost there. He does not comment on too many of the other cosmics. He escaped Thanos through the SS doing something. Galactus thinks him dead.
Galactus makes Frank his herald and they go off together. The narrations say that they have been doing battle and adventuring for a hundred years or more. They confront Thanos, who kills Galactus with one blast. Thanos then says that he cannot kill GR but GR cannot hurt him either.
Ghost Rider becomes a lacky for Thanos at that point.
Who managed to kill off all of the heros, and wound Galactus so badly? Thanos cannot, apart from having IG/HOU os another artifact!