Why do bad things happen to good people? This is the central question in the Book of Job, which I think is the most interesting book in the Bible, so far.
Job is a good guy who has a great life and then he loses everything; his family, his wealth and his health. He sits there, feeling dejected and in pain from horrible boils on his skin, cursing his life, ruing the day he was born, but... he never curses God, even when his wife says he should, and his friends say he must have done something to deserve his bad fortune. But that's the thing, he hadn't done anything wrong at all. Satan had brought about his misfortune in order to prove to God that people are only good when things are going well. In the end, however, God is proved right -- Job never loses his trust in God, and so God brings back the good things in his life, and more, including his children who had died.
This book is powerful in its plot as well as in its poetry:
"Let the day perish wherein I was born, and the night in which it was said, There is a man child conceived. Let that day be darkness; let not God regard it from above, neither let the light shine upon it. Let darkness and shadow of death stain it; let a cloud dwell upon it; let the blackness of the day terrify it.
"As for that night, let darkness seize upon it; let it not be joined unto the days of the year, let it not come into the number of the months. Lo, let that night be solitary, let no joyful voice come therein. Let them curse it that curse the day, who are ready to raise up their mourning. Let the stars of the twighlight thereof be dark; let it look for light, but have none; neither let it see the dawning of the day;
"Because it shut not up the doors of my mother's womb, nor hid sorrow from mine eyes.
"Why died I not from the womb? why did I not give up the ghost when I came out of the belly? Why did the knees prevent me? or why the breasts that I should suck?
"For now should I have lain still and been quiet, I should have slept: then had I been at rest," -- Job 3:3-13
"For I know that my redeemer liveth, and that he shall stand at the latter day upon the earth: And though after my skin worms destroy this body, yet in my flesh shall I see God." -- Job, 19:25-26