New Jerusalem Bible, Standard Ed. 1998; Job 6 One day the sons of God came to attend on Yahweh, among them came Satan. 7 So Yahweh said to Satan 'Where have you been?' 'Prowling around the earth,' he answered, 'roaming around there'. 8 So Yahweh asked him 'Did you pay any attention to my servant Job? There is no one like him on the earth, a sound and honest man who fears God and shuns evil.' 9 'Yes,' Satan said, 'but Job is not God fearing for nothing, is he? 10 Have you not put a wall around him and all his domain? You have blessed all he undertakes, and his flocks throng the countryside'. 11 But stretch out your hand and lay a finger on his possessions and I warrant you, he will curse you to your face.' 12 'Very well' Yahweh said to Satan 'all he has is in your power. But keep your hands off his person'. So Satan left the presence of Yahweh.
The book Job goes on to relate that Job remained faithful and Satan told Yahweh that if he were allowed to touch Job's person he would become unfaithful. When this is done Job wavers and his friends console him. The rest of the book is basically theology. Job resolves his dilemmas to Yahweh's satisfaction and restores Job's life.
I was in a discussion about the presence of 'evil' in the world, and how God allows it. One of the fellows offered that the world is a test of the soul. That does sound reasonable to me. Of course some presumptions there, the soul, the afterlife etc. I'm inclined to believe in reincarnation, just a feeling. I think the verdict of your life is played out in your next one. I'm just taking off from the Buddhist tenets about coming to terms with suffering, being as righteous as possible and moving on to better things. I'm also reminded of the famous Jim Morrison line 'You cannot petition the Lord with prayer'. I imagine your works are your prayers.