The entire book of Job is a probe of the vexed question, Why do good people suffer if there is a just and good God in charge? This question threatens the coherence of Christianity.
The book of Job is part of the Hebrew Bible, accepted by the Jewish people as worthy of being included in the Scriptures at approximately the same time parts of the New Testament was written -- around the year 100.
The book is fairly long and wordy, but you can get the main points by reading the following parts:
Chapter 1 through Chapter 3 in which we are introduced to Job as a blameless and upright wealthy man who had it all, and who suffers enormous crushing losses because God agrees to use him as evidence against the Devil's power. Three friends show up to comfort him, but don't know what to say.
Chapter 4 and verses 17-27 of Chapter 5. Here we find Eliphaz, the first of the three friends, trying to explain why Job is suffering so. You will probably recognize someone you know in Eliphaz' approach.
Chapter 6, verses 24-30, and Chapter 7. Job rejects Eliphaz' "comfort" as being totally unsympathetic with the reality of Job's suffering. Job presses his anguished question, Why has God done this to me?
Chapter 8, verses 1-7 and 20-22. Bildad, the second friend, gives a rather harsh, but common religious answer to Job's question. It's the same line that Christian ministers Falwell and Robertson gave on the TV show, "Praise the Lord" to explain why God allowed Islamic terrorists to attack the US.
Chapter 9, verses 17-24 and Chapter 10 verses 1-7 and 18-22. Job rejects Bildad's unsympathetic approach, and asks that he just be allowed to die.
Chapter 11. Zophar, the third friend, tries to tell Job why God is doing this to him. His line seems similar to Bildad's.
Chapter 12, verses 2 - 6. Chapter 13, verses 1-12. Job sharpens his rejection of the line he is being given by his friends. Some pithy and on-target remarks from Job about the injustices found in the world and the complacency of his "friends".
Chapter 13, verses 13-18. Chapter 14, verses 1-2. Job asserts that he has a good case against the justice of God's allowing him to suffer like this. He concludes that life sucks.
Chapter 15. Eliphaz criticizes Job for questioning God's justice, and says that the act of questioning just makes Job a bad person who deserves bad things. (Does Eliphaz remind you of anyone you know?)
Chapter 19, verses 21-22. Job complains about his friends' approach.
Chapter 35, verses 13-16. Chapter 36, verses 5 -11. By this time in the story, Job's three friends have given up trying to work on him, and the task has been taken up by a younger man, Elihu, who apparently has been there all along, but silent until Chapter 32. He is angry at Job for questioning God's justice, and he is angry at the three friends for failing to do a good job of getting Job to see that God is just. In these verses he takes a slightly new line with Job, asking him to be patient, and assuring him that God is listening to his cries of anguish.
Chapter 38. God finally answers Job. (Chapter 39 through 41 continue God's answer, but they seem to merely continue the line of thought presented in Chapter 38.)
Chapter 42. Job is reconciled with God. God rebukes the three friends for misrepresenting the truth about God. (In what respect did they misrepresent the truth?) We get a Hollywood ending. I am disappointed with the ending -- it seems artificial. But even if the ending is accepted as authentic, isn't this Chapter saying that, yes, it was indeed unjust for God to allow such terrible things to happen to Job? Don't forget the beginning of the story. There was absolutely no indication that God believed Job to be a bad person. In fact, just the opposite: God allowed the Devil to test Job because Job was such a faithful person.