Since we believe that God is the author of this planet and is sovereign over it, it's inevitable that we ask where he is when these terrible things take place.
I think the Bible answers that over and over again from different angles and in different ways. We find our first answer, of course, in the book of Genesis, in which we're told of the fall of humanity. God's immediate response to the transgression of the human race against his rule and authority was to curse the earth and human life. Death and suffering entered the world as a direct result of sin. We see the concrete manifestation of this in the realm of nature, where thorns become part of the garden and human life is now characterized by the sweat of the brow and the pain that attends even the birth of a baby. This illustrates the fact that the world in which we live is a place that is full of sorrows and tragedy.
But we must never conclude that there's a one-to-one correlation in this life between suffering and the guilt of the people on whom tragedies fall. If there were no sin in the world, there would be no suffering. There would be no fatal accidents, no random shootings. Because sin is present in the world, suffering is present in the world, but it doesn't always work out that if you have five pounds of guilt, you're going to get five pounds of suffering. That's the perception that the book of Job labors to dispel, as does Jesus' answer to the question about the man born blind (John 9:1-11).
On the other hand, the Bible makes it clear that God lets these things happen and in a certain sense ordains that they come to pass as part of the present situation that is under judgment. He has not removed death from this world. Whether it's what we would consider an untimely death or a violent death, death is part of the nature of things. The only promise is that there will come a day when suffering will cease altogether.
The disciples asked Jesus about similar instances—for example, the Galileans' blood that was mingled with the sacrifices by Pilate or the eighteen people who were killed when a temple collapsed. The disciples asked how this could be. Jesus' response was almost severe. He said, "Unless you repent, you will all likewise perish," again bringing the question back to the fact that moral wickedness makes it feasible for God to allow these kinds of dreadful things to take place in a fallen world.