Job: A Comedy of Justice is a novel by Robert A. Heinlein published in 1984. The title is a reference to the biblical Book of Job and James Branch Cabell's book Jurgen, A Comedy of Justice.
The story examines religion through the eyes of Alex, a Christian political activist who is corrupted by Margrethe, a Danish Norse cruise ship hostess - and who loves every minute of it. Enduring a shipwreck, an earthquake, and a series of world-changes brought about by Loki (with Jehovah's permission), Alex and Marga work their way from Mexico back to Kansas as dishwasher and waitress.
Whenever they manage to make some stake, an inconveniently timed change into a new alternate reality throws them off their stride (once, the money they earned is left behind in another reality; in another case, the paper money earned in a Mexico which is an empire is worthless in another Mexico which is a republic). These repeated misfortunes, clearly effected by some malevolent entity, make the hero identify with the Biblical Job.