Just wanted to chime in here with a book suggestion : "The Problem if Pain" by C.S. Lewis. Tackles this problem from a christian apologista perspective. Its about as intellectual an analysis as you are going to get on this subject matter. I personally don't agree with 100% of it, but Lewis always presents arguments I never would have considered otherwise. Worth a read. Also, listening to scientists and engineers disc…
Here is an example of what C.S. Lewis has to say in his book: "If the universe is so bad… how on earth did human beings ever come to attribute it to the activity of a wise and good Creator? Men are fools, perhaps, but hardly so foolish as that."
Perhaps I am a small-minded engineer, but that seems like an incredibly weak argument. The linked article, on the other hand, presents the best of the counter-arguments; I don't think C.S. Lewis adds anything of value.