C.S. Lewis, one of the greatest writers of the 20th Century, and also one of the great Christian apologists in the modern era, wrote The Problem of Pain in a time and place where nearly everyone around him was dealing with a considerable amount of pain (of some kind or another). Lewis, writing in London as the Nazi bombs fell from the sky, makes an incredible stance in the defense of how pain and suffering do not disprove God, but rather are proof of Him. The question of how a good God can allow for so many bad things to occur is one that was asked frequently during Lewis's life and, perhaps, more so (though less deservedly) today.
While I cannot claim to understand everything that Lewis was trying to convey to his readers (it may take several years and several re-reads for that to happen), I can say, with conviction, that The Problem of Pain is a great resource for any person (Christian or otherwise) who wonders why pain and suffering exist in a world that is ruled by a supposedly good God. As mentioned above, Lewis takes the position that instead of being evidence against a good God or the goodness of God, pain and suffering are in fact evidences of a good God, so abounding in love that we cannot begin to understand the level of such a love. As a former atheist, Lewis understands how unbelievers think because he himself used to think that way. He uses his past beliefs to identify with non-Christians and his current beliefs to reach out to practicing Christians.
In order to grasp the basic thesis of the book, one would have to read it several times. This is not a detriment to talent or presentation of the author, but rather a testament to the complexity of the subject. As sinful human beings, it is incredibly hard to grasp the perfection of God, and because we cannot understand perfection we cannot understand how there can be a perfect being who allows imperfection to exist. In so many words, Lewis answers this dilemma by pointing to God's love. God created man with free will; He made man not to love Himself, but so that He could love them. Because He loves man, He gave man free will. With this free will came the option to not love God. When Adam and Eve sinned, they chose not to love God. This first sin marked the entrance of pain into the world.
I cannot begin to explain as well as Lewis the logic behind his arguments, but he basically argues that because of the goodness of God, because of his presence, we are also aware of the opposite of goodness; which is, of course, evil. One cannot have good without evil or evil without good. That is just the way it is. If you are confused, I don't blame you; it is a very difficult question and a very difficult thing to understand.
What it all comes down to is faith. As sinful beings, we cannot begin to grasp the knowledge of God or the motivations that guide His thoughts. Faith, though, creates in us a trust that God knows what is best for us. If this is not a good enough explanation, I strongly urge you to read The Problem of Pain. C.S. Lewis is much more intelligent than I and can explain things in a way that I can only hope to be able to. If it doesn't change your thinking, it will certainly make you think some more.