Photo: fmajor/Getty Images

A few years ago, psychological scientist Kurt Gray came across the final statements of 500 Texas inmates executed between 1982 and 2013. (The state’s Department of Criminal Justice posts them online.) As he read these inmates’ surprisingly sanguine last words, Gray wondered if their positivity was a fluke or part of a broader psychological trend.

So he conducted a study at the University of North Carolina, Chapel Hill, which compared the words of death row inmates and terminally ill patients to those simply imagining they were close to death. This research —published this summer in Psychological Science — suggests that while it’s natural to fear death in the abstract, the closer one actually gets to it, the more positive he or she becomes.

In the first phase of the study, Gray and his colleagues analyzed the blog posts of terminally ill patients with cancer or amyotrophic lateral sclerosis (ALS), which the patients had kept on their own, independent of the study. (They had to have written at least ten posts over a three-month period and died during this time.) Gray compared these posts to blog posts written by healthy people who were asked to imagine that they had been diagnosed with untreatable cancer, and that they had created a blog for which they should write a single entry about the experience.

The results showed that the terminally ill patients’ words were more positive on average than the ones written by the non-patients. For example, one patient wrote: “I may not have much more than a few weeks left on this earth, I’ll be spending it with the people I love — doing the things I’ve missed. Thank you all for everything you’ve given me on the way. All I can say is that despite my current condition, I’ve enjoyed a life with far more than most.”

Another wrote: “My happiest times are spent with Seth, my mom, and my animals. It’s just wonderful since we moved my mom and the animals to be close to me! That really was and is the most important thing for me, to have my loved ones as close as possible.”

Moreover, the closer the patients were to death, the more positive emotional words (“happiness,” “love,” etc.) they used. This is thanks to the human “psychological immune system,” a concept that the Harvard psychologist Dan Gilbert wrote about in his 2007 best seller, Stumbling on Happiness. Confronted with a terrible situation, our minds work overtime to find a bright side or some larger reason for what’s happening. This is how we fashion silver linings like, “I hated that job, anyway” or “She wasn’t the One” or “He’s in a better place.”

The psychological immune system works hardest when we are at our lowest or most trapped, and nothing instills terror quite like impending death. Gray says, “The psychological immune system is mostly engaged when it really has to be, when bad things happen — and nothing seems worse than death. So when one is faced with death, all sorts of rationalization and meaning-making processes come in.” These processes kicking into overdrive accounts for how someone with terminal cancer or on death row would grow progressively more upbeat, not less.

Optimism also abounded in the second phase of Gray’s study, when his team compared the final statements and poems of the death row inmates to a set of statements written by online participants (who, like the non-patients in phase one, were given a prompt: “Imagine that you are about to be executed for your crimes. Please write your last words”). Again, the words of the dying proved more positive and less negative than what people imagined. With their last breaths, many inmates expressed love and gratitude for their family and friends, or said they’d see them in heaven:

• “To my loved ones and dear friends, I love y’all and appreciate y’all for being there. I am going to a better place. To all the guys back on the row, keep your heads up, keep up the fight. I am ready. Let’s go.”

• “I love you Irene and I want to thank you for all the beautiful years of friendship and ministry. I love you.”

• “Sir, in honor of a true American hero, ‘Let’s roll.’ Lord Jesus receive my spirit.”

• “Tell my son I love him very much. God bless everybody. Continue to walk with God. Go Cowboys!”

Many said they were at peace; “I’m ready” was a common refrain. (Of course, not all inmates were so content. Some said they were innocent, others declined to make a statement, and at least two directed profanities at prison staff.)

As with the terminally ill subjects, staring down death forced the inmates to rationalize — which often demands looking beyond oneself, to family or religion. Gray elaborates: “What we found in the last words is that people are really finding meaning in death: ‘I’m going to meet the people I care about,’ ‘I’m going to do something for Jesus.’ And telling their family and friends that they love them. Part of the reason they were so positive is because they were focused on other people.”

Those of us who are not dying, on the other hand, tend to be “selfish when we think about death — we think about ourselves and how hard it would be for us,” Gray said.

That egocentric mentality helps explain why the imagined last words were more negative than the real ones. In a sort of extreme form of navel-gazing, the online study participants (in both phases) often dreaded or bemoaned their fates, using words like “fear,” “terror,” and “anxiety.” Meanwhile, those actually dying were more likely to say how grateful they were for their loved ones, or to assert their belief in a higher power and afterlife.

Although this new study did not include elderly people on the verge of dying of old age, a 2016 University of Cambridge study of 42 people aged 95 and older found that most of them did not fear or fret over death. Like the patients in Gray’s study, many seemed at ease with their lives and took things one day at a time. They didn’t talk about death much, but most knew it was around the corner, and they were okay with that.

One subject in the Cambridge study said, “I’m ready to go.” Another pleaded, “Please don’t let me live ’til I’m a hundred.”

A significant implication of this research concerns death-with-dignity laws, which are currently on the books in California, Colorado, Oregon, Vermont, Washington, and the District of Columbia. These laws allow terminally ill patients (those with six or fewer months to live) to receive prescription drugs that will hasten their deaths.

I asked Gray if he thought his study bolstered the case for death with dignity. “Absolutely,” he said. “Those who are not dying imagine death to be so terrible that they just want to avoid it. But if it’s happening to you and it’s inevitable, you might not want to escape it so badly. You may want to go out on your own terms.”