The story of Job is very significant, not only as a theodicy but as a clear instance of beatific vision. See my essay: Why Talk About God When You Can See It? God is known to be with the sick, the suffering and the oppressed (Riyad as-Salihin 6:3 & Matthew 25:31-46) but what does that mean? The story of Job provides an example.
Job hits rock bottom. He loses all his wealth, health, family and friends. Whereas his wife tells him to “Curse God and die” (Job 2:9) Job chooses to ‘maintain his integrity’ and be faithful to God and his wife (38:44) who seem to have forsaken him. In this moment of complete desolation, Job has a theophany (Job 40). Normally, one cannot see God and live (Exodus 33:20). However, there are some exceptional instances, like the Israelites and Moses at Mount Sinai, who ‘heard’ God and lived (Deuteronomy 4:33). The Qur’an suggests this means they died temporarily and were resurrected when they received the covenant at Mount Sinai (vv. 2:55-56). It is thus possible to die while a person is alive, which accords with the mystic aphorism “Moot qabl an-tamoot” (“Die before you die”). It is also possible to be ‘reborn’ or resurrected in this life (John 3:3) before a future cycle.
Job, in his misery, sees God, who is otherwise invisible behind a veil of illusory distractions. By maintaining his integrity in the utmost adversity, Job learns the greatest mystery and receives a double portion of vitality (Job 42:10 & v. 34:37). How this is possible isn’t supposed to be entirely clear to someone who does not know God, or who has not seen it. The Book of Job contains a great secret.