Job has done everything he was supposed to do. For a while, it looked as if the formula was working for him. He had a big family and a lot of wealth.
Then things fell apart.
The Adversary (we read Satan although the text does not say so) contends to the Lord that Job was a good man only because he had lots of blessings (Job 1:6-12). Then when Job still did not sin even after losing his possessions (1:13-22), the Adversary argued that Job would change his attitude if he himself was injured.
The Lord agreed to this test. The Adversary afflicted Job with a painful skin ailment. Job's wife urged him to blaspheme God.
Instead, he said, "Should we accept only good from God and not accept evil?"
After receiving devastating news and living through its aftermath, Lawrence Kushner wrote When Bad Things Happen to Good People that explores the theological underpinning of this question and how it worked out in his family's life.