There are many answers to this question -- but my favorite is that suffering can lead to eternal joy.
I experienced this phenomenon myself, first hand: It was 16 years ago that the Lord called my 87-year-old Christian mother home to heaven, leaving me, a committed atheist, utterly heartbroken -- and desperate to know if she'd been right after all, if she might still exist somewhere, and if so, how I could get there, too.
It was my intense grief that forced me to consider what Jesus Christ called, in Matthew 7, the narrow gate to life. And it was that same grief that propelled me through 15 months of fierce investigation, until I could at last bow my heart to Him with complete confidence that He is indeed God and did indeed die to pay the penalty for my sins and yours.
Stories like mine underscore one of the primary reasons that our Creator allows pain and suffering in this world: For some of us, it's the only way He can get our attention.
Sometimes this suffering afflicts atheists and agnostics only indirectly, with the actual pain being borne by their beloved believers. Many of the friends I have called on at the nursing home over the years, for example, have suffered relentless pain -- yet their faith has remained steadfast for all to see. Could such circumstances be designed to draw their dear unbelievers through the narrow gate to their sides?
I certainly can't know, and the Bible does alert us to many other purposes for affliction. But I have seen this particular scenario play out more than once, with the lost being gloriously saved as they watched their loved ones find supernatural solace in the Lord.
I guarantee that, for these elderly believers, it's worth any price to see family and friends become heaven-bound -- even when that price is profound suffering in this life.
For they know, as the apostle Paul wrote in 2 Corinthians 4, that "Even though our outward man is perishing, yet the inward man is being renewed day by day. For our light affliction, which is but for a moment, is working for us a far more exceeding and eternal weight of glory, while we do not look at the things which are seen, but at the things which are not seen. For the things which are seen are temporary, but the things which are not seen are eternal."
Adapted from a 5/31/14 post