I was also sorry that the great Scottish writer Iain Banks died of cancer the other day. He had a different outlook. Iain said if he was a theist, he'd have been wondering "Why me, god?" As it was, it was just his misfortune. People have different coping strategies.
I watched over my atheist farther during the last 3 years of his life and during that time span he became somewhat religious. So all I can say from witnessing this change is that when suffering and death are near you will cry out to god. Maybe not all of us but I believe most of us will. And yes he found comfort in that. Just wanted to pass this on to others. Best wishes to all.