The Problem of Evil has apparently been a cornerstone of religious criticism for a rather long time, dating back even to the Greek philosophers. I recall reading that the guy it's usually attributed to probably didn't actually say it, so I won't bother looking him up just to mention him by name. In its original form, the argument went something like this:
1. If God is willing to prevent evil but not able, he is not omnipotent.
2. If God is able to prevent evil but not willing, he is not benevolent.
3. If God is both able and willing to prevent evil, why is there evil?
4. If God is neither able nor willing to prevent evil, why call him "God" at all?
4 is relatively easy to dismiss, but it's not even material to the argument, because this combination of truth values isn't necessary to give us the world we see. In any case, I suppose it merits a better definition of "calling him 'God'". There are plenty of figures I can name from the various polytheisms who are neither omnipotent nor benevolent, but whom I would still call "gods" (minuscule "g" as if you couldn't read it, but I find it necessary to point it out for the sake of contrast) based on their descriptions. Perhaps the majuscule "G" in "God" tells me that this is a more particular kind of deity, in which we expect to find the qualities of omnipotence and benevolence. If that's the case, I could say that either points 1 or 2 could include an implication that the god we're talking about isn't the God that we expect him to be. In any case, point 4 isn't terribly relevant, nor is it particularly difficult to attack logically.
Irrelevant point 4 aside, what we have is a conflict between two qualities, omnipotence and benevolence, and the world we see. It's not difficult to escape through the metaphorical horns of this constructive dilemma, though.
For the sake of form:
1. IF [God is willing to prevent evil] AND [God is able to prevent evil] THEN [There is no evil]
2. It is FALSE that [There is no evil]
3. Therefore, it is FALSE that [God is willing to prevent evil] AND [God is able to prevent evil] (modus tollens, 1, 2)
4. Therefore, EITHER it is FALSE that [God is willing to prevent evil] OR it is FALSE that [God is able to prevent evil] (De Morgan, 3)
5. IF it is FALSE that [God is willing to prevent evil] THEN it is FALSE that [God is benevolent] AND IF it is FALSE that [God is able to prevent evil] THEN it is FALSE that [God is omnipotent]
6. Therefore, EITHER it is FALSE that [God is benevolent] OR it is FALSE that [God is omnipotent] (constructive dilemma, 5, 4)
On the one hand, I'm glad that I was still able to do that after over a year since my last Formal Logic class. On the other hand, I apologize for subjecting you to that. I probably should have told you beforehand to just skip it.
Anyway, proofs aside, it's relatively easy to posit that "God is not omnipotent" and "God is not benevolent" are not the only two possible ways to reconcile God with the fact of evil in the world. Perhaps there's a reason why some degree of evil must be tolerated -- for instance, a greater ultimate good that will outweigh the minor evils along the way. So far I've come up with two rather compelling arguments for why this may be plausible.
1. Free Will. Humans have to have the freedom to choose to be good or evil, or else their goodness will be meaningless.
2. Character Building. In order for life to have a point at all, people must endure some form of suffering so that they can come through it as better people.
The argument of Free Will falls fairly easily. All I have to do is introduce the concept of natural evils, i.e. those that aren't caused by humans. Your natural disasters, for example. It's easy to see that natural evils would still be relevant to Character Building, but if Free Will is God's only rationale for tolerating evil, it doesn't explain the existence of natural disasters that in fact do not disproportionately target the houses of atheists. I still feel it's necessary to address Free Will, though, because it relates closely with the concept of the afterlife and divine justice.
I'll start, though, with one of my famous* metaphors. Imagine a robot. No, no lasers. No, he doesn't beep like R2-D2. Something more like the sort of robot the Mythbusters would build. The purpose of this robot is to roll dice. And no, I don't mean a dice-rolling program on a computer. Not just to roll them, but to actually predict the result of a physical die-roll that the robot itself makes before the dice are in motion. This robot is attached to a closed-off, airtight rolling box, so that air currents from outside have no effect on rolls. The robot has a small flicking arm capable of holding (say) one six-sided die (which you'd rather read as "1d6" if you're awesome), and this arm is capable of making minute adjustments to the vector of the toss and the sum of forces on the corners at the time of release, the better to control the die's rotation in the air. The robot has a computer programmed with an elaborate schema for correlating a range of various toss vectors with specific rotation characteristics, ultimately resulting in a predictable result. If the potential for random Brownian motion to interfere is weighing too heavily on your willing suspension of disbelief, you're welcome to imagine that the rolling box contains a perfect vacuum, aside from the robot and its d6.
*My metaphors are not actually famous. Yet.
Now, this die-rolling robot is capable of predicting everything that might pertain to its die rolls, aside from the potential for humans to interfere by suddenly moving the rolling box or introducing a foreign substance into it, which needn't be considered for the sake of this argument. Our theoretical robot here is omniscient for the intents and purposes of rolling its die in its rolling box. If we plug a number from 1 to 6 into its little console, it will faithfully and reliably throw the d6 such that it rolls several times and lands with the face we specified pointing up. This process in the hands of a human would be considered random, because we have nothing close to the precision and calculating power of this robot. In addition to our robot effectively knowing everything there is to know about its rolling space and the behavior of its die, it is also capable of effecting any of the six possible results that can be achieved from rolling a d6 (minus the patently ludicrous possibility of getting the die to balance on an edge or, more so, a corner), which makes the robot also omnipotent as far as rolling this die is concerned.
Even though our robot is capable of reliably effecting our desired roll results at will, it does so without manipulating the die every quantum of time along the way, or even at all once it is released from the flicking arm. The point is that, because of its effectively omniscient computer program, the robot can predict how the confluence of many significant forces, including the direction and speed of rotation, the angle and speed at which it strikes the bottom of the box, and the cumulative effects of every single bounce, will come together to create the same roll every time. If humans were capable of the precision necessary to throw a die the exact same way into the exact same environment, we'd be able to effect the same result every time.
Now consider causality. Every event that happens in our experience can be traced back to a first cause. There's a chain of causes and effects leading from everything you do, back through every interaction since the moment of your birth, back to the random shuffling that gave you the particular genes you got from your parents, to the events that drove your parents together in the first place, etc., back through the history of life on Earth and matter in the Universe. This chain of causes is one thing that gives time travelers so much trouble. This chain of causes is analogous to the various forces acting on our die. An omniscient God is cognizant of all of these causes, and how every single interaction between entities will result. If God is omniscient, then he knew every single result that would come from creating the universe the way he did. This God is the ultimate die-tossing robot. Before God created Adam and Eve, he knew that they would fall. Before God decided to destroy Sodom and Gomorrah, or to flood the Earth, in order to purge them of their sins, God knew that the sins would take place.
In essence, if God was omniscient when he created the world the way he did, he therefore knew that his creation would lead to everything every person ever did wrong. To say otherwise is to posit that God is not omniscient. This leads me (and hopefully you as well) to the conclusion that, if God is omniscient and benevolent, he could not possibly punish anybody (even a little) for acting the way that his own actions determined.
I've got another famous metaphor** for you. Imagine a soldier is on patrol in enemy territory. He spots a camp of enemy soldiers situated at the top of a cliff, which he confirms does not have any civilians on hand. He calls back to base and orders a cruise missile strike. The missile flies in, explodes at the center of the enemy camp, and kills all the bad guys; the civilian village at the base of the cliff, however, is promptly destroyed by the resulting landslide. Is it the patrolling soldier's fault or that of the base officers who launched the missile? What if, back at the base, they had easy access to a live satellite feed of the area, which clearly showed the civilian village at the base of the cliff? Is the onus for the lost lives now on the officers who failed to check that feed?
**In the past four paragraphs, my metaphors became actually famous. Read about them in Time magazine!
Effectively, God sending somebody to hell for actions they performed in life is no better than the soldier above getting severely punished for wiping out the civilian village. Omniscient God was aware, when he created the universe, that the great confluence of forces within it would cause particular individuals to perform in less-than-optimal ways; in fact he knew what each individual was going to do from the moment he decided to create creation. The officers at the base knew that there was a civilian village in the line of fire before they launched the missile. It's within omnipotent God's power to prevent any particular instance of evil, and it's also within his power to design the world in such a way that those evils are naturally avoided. We cannot have free will, because everything that happens in our brains is the result of genetics, experience, or quantum die rolls; omniscient God knew beforehand how the world would resolve to give us the genetics and experiences we each have, and omniscient God knew how every die roll would come up. Yes, the calculations are far beyond anything that we humans can conceive, but hey -- this is omniscient and omnipotent God we're talking about.
So, here we have it that a God who is omniscient and sufficiently powerful to change the way he creates the universe cannot endow any of his creations with free will. If God was the first cause, and all other causes flow forth from that cause, and if God is omniscient, then nothing that happens could possibly be outside of God's knowledge prior to the creation. While that doesn't perfectly shore up the Problem of Evil, it does render the notion of cosmic punishment patently ludicrous.
Now, if you recall from way back when I first mentioned it, there's another reason why we might conceive that a benevolent and omnipotent God might have to allow evil: Character Building. If people never suffer, then their lives are worth nothing, because they will then have no concept of happiness versus sorrow. But if all we're looking for is a Crowning Moment of Heartwarming to teach us a nice lesson about life, it rather seems that God is going a tad overboard.
Most glaringly, different people suffer in different amounts. One particularly lucky person might go through life with nothing worse than a nasty flu one season and a handful of crummy days at work. Other people have their families tortured and horrifically murdered before their eyes, and then have the same happen to them. The idea that one of them deserves it more than the other is right out, because we did away with the concept of free will and cosmic punishment in the last bit. At the very least, can't God put some kind of cap on the suffering per capita?
While we're at it, consider the fact that the quality of life we see these days is probably, at least on average, much higher than it has been in earlier human history. If the suffering we see today is sufficient to give our lives character, why did people of centuries past need so much more? Why not take a look at the progression of suffering throughout an individual's life? The worst thing a small child will have to suffer (aside from the possibility of abuse by adults and other tragedies) is the loss of a beloved toy or otherwise being deprived of a chance at something enjoyable. This is, forgive the metaphor, child's play next to the pressures of school and the inevitable angst that comes with being a teenager. This again is rather eclipsed by the work and financial difficulties of adults, not to mention the fact that adults have to deal with the births and deaths of people who are important to them. Further still, we can see the average civilian adult's complaints pale in comparison to the horrors witnessed and suffered by a veteran soldier. And yet, many people die before reaching the next level of suffering, and most of them go their entire lives without participating in violent warfare. If any one of these levels of suffering is sufficient for God to consider a life "complete", why not stop at the lower ones?
So. At the crux of benevolence, omnipotence, and omniscience, we can see that there's no good reason to have the particular degree and sort of evil we see in the world. Remember, though: the problem of evil should never be taken as a supposed proof against God. It should only be taken as a proof against the sort of God we're usually told we have. If the Bible tells us we have an omniscient, omnipotent, and benevolent God, and we can use reason to see that at least one of those traits has to be out of the game, we can therefore determine that, at least on one point, the Bible is wrong. If the Bible can be wrong about one thing, then we know it's false that the Bible is right about everything: the credibility of the whole document is shot.
So my point in invoking the problem of evil is not to say that God does not exist. It's to say that if God exists, we don't know what he would want us to do in life because we don't have an authoritative source. We cannot know whether God wants us to pray or how, and we don't know what he considers "moral". The rational conclusion from this is that the only criteria for how best to live life are secular criteria: the greatest possible degree of good for the greatest possible number of people. Don't accept evil, and don't assume that praying is enough. Do something about it yourselves.