Until Chapter 38, Job is speaking from his own wisdom and thoughts, his understanding of God, his religion (many do not believe Job was a Jew) and perhaps even his desperation, just like we do at times. He is a crazy man in pain, covered with boils who just lost almost everything. He does not understand all that has happened and in his confusion, pain, grief, and lack of understanding he is asking, "Why God?” defending himself by claiming that his own righteousness will be proven.
The origin of the testing was not God but Satan who believes that Job serves God because he is blessed. So, God allows the testing, but gives Satan limitations, knowing that what Satan means for evil, He/God can and will use for good. Notice the result of the testing.
Job come to know God and have relationship with Him, where previously he only heard of Him, but now he sees Him. “I have heard of You by the hearing of the ear, but now my eye sees You.” Relationship is advanced.
Job was a man of fear, praying for his sons that they not be punished by God for something they did in feasting. At the end, Job no longer walks in fear of God’s retribution or punishment, but sees the goodness, majesty and wonder of God. Job trusts God’s goodness and is no longer in fear of Him.
Job believes that there is purpose in his testing. He speaks boldly, “But he knows the way that I take; when he has tried me, I shall come out as gold.” To Job, the testing is to reveal His goodness. This isn’t what happens. Job doesn’t come out as gold.
I note that it isn’t Job that comes out as gold at the end. After God reveals Himself, Job says, “Therefore, I abhor myself, and repent in dust and ashes.” Job does not consider that he came through like gold. The testing reveals Job’s lack, in the place where he receives God’s great abundance and mercy in restoration. GOD comes through as gold. God blesses Job at the end, but not because of anything he did. IF we believe God blesses for our actions, then the actions God blessed were, 1) Job coming to end of himself, 2) Job seeing God for who He truly is.
The transformation in Job’s life didn’t come as he was proven ‘golden’ but as He saw the God who is (golden) perfect in all His ways.
The New Testament version of this is that testing reveals the substance something is made of, not what it is not. Brass is not tested to show it is not gold, rather gold is tested to prove that it is gold. In a like way, God tests us – not to show us what/who we are not, but rather to reveal the truth about us. Over 200 times in the Bible He speaks of our identity, IN HIM. We are loved, righteous, pure, holy, chosen, adopted, sons and daughters, the bride, undefiled, forgiven, etc. etc. When we are tested, it is so that He comes through as gold. He lives in us, we have His nature, we are new creations and God acts as the sculptor who tap, tap, taps away the lies we believe about ourselves, often based on our actions, behaviors, or the judgment of others, all to reveal the gold within, “Christ in me.” Scripture says, “in Him we live and move and have our being.” Sometimes, I need to be reminded that my life is His and my true desires are His.
Second, with respect to Job not finding God.
In our desperation we often do not see God's presence in our lives. God tells us to 'stand still and see the salvation of the Lord, which He will accomplish for you today', and 'the Lord shall fight for you and you shall hold your peace' and 'in returning and rest you shall be saved' and 'He is not found in the wind, or earthquake or fire, but in the still small voice’ and ‘a rest remains for the children of God’ and ‘He makes me lie down beside the still waters’ and from Jesus, ‘Peace I leave with you, peace I give you….let not your heart be troubled.” In trials, in tribulation, in trouble and when our worlds are shaking we are invited to choose to stop... look to Him - at Him as He reveals Who He is for us. It was in 'seeing God - although he had heard of him in the past' that he was able to go on, to walk in his gifting (as one who prays), and to find peace even while he was still afflicted.
This is the beauty of Job.