O LORD, you have searched me and known me!
You know when I sit down and when I rise up; you discern my thoughts from afar.
You search out my path and my lying down and are acquainted with all my ways.
Even before a word is on my tongue, behold, O LORD, you know it altogether.
You hem me in, behind and before, and lay your hand upon me.
Such knowledge is too wonderful for me; it is high; I cannot attain it.
Where shall I go from your Spirit? Or where shall I flee from your presence?
If I ascend to heaven, you are there! If I make my bed in Sheol, you are there!
If I take the wings of the morning and dwell in the uttermost parts of the sea,
even there your hand shall lead me, and your right hand shall hold me.
If I say, "Surely the darkness shall cover me, and the light about me be night,"
even the darkness is not dark to you; the night is bright as the day,
for darkness is as light with you. Psalm 139:1-12
The role of God in hard times is difficult because it's easy to get side-tracked on issues that don't necessarily help. Many an agnostic has claimed his belief stems from the conviction that "a good God wouldn't allow ___ to happen." The agnostic thinks he is drawing away from the microcosm of suffering and reaching back to the meta-narrative of the core issues — does God even exist? If so, how can He allow suffering? Unfortunately, he is merely stepping back into the meta-narrative of "How can my experiences determine if God exists?" He is attempting to make a philosophical conclusion out of his experiences instead of relying on the highest meta-narrative: truth.
The agnostic doesn't realize his very pre-suppositions have given all the evidence for God that he needs. Things happen — cancer and tornadoes and war. But aside from a deity who declares it so, there is nothing that can judge such things as "bad." They may be painful or cause sadness or anger. But who is to say something that causes pain, sadness, or anger is "wrong" unless there is something/someone above the situation who can define what "right" is. This is the Moral argument for the existence of God — there can be no morality without God.
Such an argument typically leads to questions about the sovereignty of God. What gave God the right to create people to suffer? If God knew Adam and Eve would sin and Satan would seek to defeat us, why did He allow it? In particular, why do unbelievers have to suffer forever?
The answer is the emotionally unsatisfying, "Because God made us that way." For whatever reason, God chose to make a type of creature that has moral choice independent of His righteousness. And He made that creature with an immortal soul.
Sometimes God gives us a glimpse into the logic. Why do people die? Because to expose them to an eternity where they can develop more and more powerful ways to hurt each other is unkind (Genesis 6:3, 5). Why do unbelievers suffer in hell forever? Because when given a choice, they rejected God, and God grants them their desire by separating their immortal souls from Him forever (Matthew 25:46). But why are human souls immortal (Daniel 12:2)? We don't know. Why did God give us moral choice (Genesis 2:16-17)? We don't know. His plan happened to involve a creature that has an immortal soul and moral choice, and our consciousnesses — yours and mine — happen to inhabit one of those creature.
But God didn't abandon us. Being creatures with an immortal soul and moral choice is a heady thing and requires an instruction manual — the Bible (2 Timothy 3:16). Which the creatures promptly ignored in an attempt to interpret their world through their own experiences and not the wisdom of their Creator (1 Corinthians 1:20). This is sin — to act according to the conclusions drawn from limited understanding instead of instruction given by an omniscient Source.
And the Source addressed the foolishness of this choice, particularly in Job 38, the great "Where were you" dissertation.
Where were you when I laid the foundation of the earth?
Tell Me, if you have understanding,
Who set its measurements? Since you know.
Or who stretched the line on it?
On what were its bases sunk?
Or who laid its cornerstone,
When the morning stars sang together
And all the sons of God shouted for joy?
It continues through chapter 38 and into chapter 39. Who are you to question the way God made the cosmos? Isaiah 29:16 says the same thing — we can no more question the wisdom of God making us with an immortal soul and moral choice than a pot can question the potter why he got a lid and the cup got a handle.
There is a branch of theistic evolution that is quite popular. It says that God set the stage. He created natural laws and universal constants and maybe even sparked the Big Bang, but He hasn't had much more to do with His creation since then. It makes God out to be like some kind of cosmic bowler who releases the ball and waits to see how the pins fall.
That isn't the God of the Bible. The God of the Bible regularly interacts with His creation — but always only for its benefit. Either He blesses and rescues people, or He removes them before they can do (or experience) more harm. All this in the context of respecting their freedom to make moral choices, if not always to act on those choices.
To our great frustration, we cannot see or know why He rides in to the rescue at some events and allows others to play out. This is the God who sunk the bases of the foundation of the earth. It's foolishness to think we can fully understand the way in which He acts through human history.
One last question that calls God's nature out. "What kind of narcissist must God be to create us just for His glory?" Why allow us to bear the brunt of others' malicious moral choices just so God can be glorified by His creation?
Way back in the long ago when I was aircraft maintenance, I learned about the concept of the Hangar Queen. The Hangar Queen was a jet that sat in a hangar, hard broke. When another jet broke, we'd "cann" or cannibalize parts from the Hangar Queen to get the second jet back in the air.
Usually the Queen was waiting on a part that was difficult to get. To my surprise though, we never left the Queen in the hangar longer than necessary. It seemed more logical to me to keep canning from her to keep the others up and running. A scheduler explained why this was a bad idea.
Planes are built to fly. They are not designed to sit on the ground for extended periods of time. The structure of an aircraft is designed to withstand the stresses placed on it by air and wind and lift and running engines. The longer a jet sits on the ground, the more broke it gets. The reason we build aircraft is to fly, and they are damaged the least when they do so.
We are the same way. It just so happens that God is most glorified when we fly. He designed us to have the most joy when we work in a way that glorifies Him. When we don't, we break. The broker we get, when we crawl into our hangar and barely glimpse the sky, the more we forget that we can fly. The sun-split clouds look scary, and we get overwhelmed with the amount of work we must do to return there. So we blame God. We refuse to do the work it takes to fly. We say it's His fault that we're broke, when initially it was just a simple little thing that required patience for the part to come in. We tell God He should have made us a jeep and that He's selfish for wanting us to fly.
Yes, God made us to glorify Him. But He also made us to enjoy life most when we glorify Him. Which makes disobedience a peculiar form of masochism.
Before we can trust God in our suffering, we need to trust God with our selves. How did God make us? With immortal souls and moral choice. Did He have the right to? As the Creator, yes. How has He supported that decision? By interacting with His creation in a way that blesses and protects. What gives Him the right to dictate how we are to interact with Him? He didn't. He gave us the choice. But it just so happens that He is glorified more when we fly than when we crawl around in dark corners.
For more on the moral argument for the existence of God, see the GotQuestions? article