Job was a faithful servant of God, healthy and rich with plenty of children. Suddenly he lost everything. Even his wife despised him. His friends, who came to console him, ended up in accusing him of very serious crimes. They insisted that God is just and would not have allowed Job to suffer if he had not committed some grievous sin.
Hence his arguments and complaints are directed not against his friends but against God Himself. Job firmly believed that it was God who was torturing him, apparently for no reason. Job complains to God but God does not respond. Though the Bible teaches that suffering is the result of sin, it need not be the sin of the one who suffers.