Shazam! comes to an end with issue 35 (May/June 1978), with a story by E Nelson Bridwell, Don Newton and Kurt Scahffenberger.
Captain Marvel and Captain Marvel Jr are still together following the end of the previous issue. They head back to New York City to see why Uncle Dudley rushed back. On the way, they encounter a bridge disappearing, and cars reverting to far older models. None of the people seem to notice anything strange going on. They visit Sterling Morris, and he seems to believe it is still the 1940s.
They go to check on Mary Batson, and find she doesn't have any recollection of being Mary Marvel, not until they get her to say Shazam. Once she changes, her awareness of the situation improves, and she is able to confirm that time has started running backwards, although normal people do not notice the effects.
The three head to the Rock of Eternity, where Shazam explains about King Kull breaking free. He reminds the Marvels (and the readers) about how the king of the beast men had waited thousands of years to revive and re-conquer the world. Now he has taken refuge in Hell, and constructed a machine that is causing the time reversion effect.
So the Marvel Family head to Hell to stop him. This is a weird mix of Christian and Greco-Roman concepts. As the three make their way to Satan's throne they have to face Charon, Cerberus, Typhon and a Siren, but overcome those.
Captain Marvel Jr tries to face Satan alone, which he had done once before in his own comic in the 40s. But now it takes all three, empowered by their victories over his minions, to defeat him.
After that, taking down King Kull and destroying his machine comes really quickly and easily.
The conclusion of the story reveals that Kull and Captain Nazi have both escaped from their imprisonment, while Billy, Mary and Freddy meet with Sterling Morris and learn what he had told Uncle Dudley, that WHIZ is on the verge of bankruptcy, and Billy's evil uncle, Ebenezer, is about to take it over.
The story continues in the pages of World's Finest Comics a couple of months down the road, as the Shazam series moves over to that book.