People who got treatment at intensive care units (ICU) or died in the hospital, for example, were more nervous and burdened by their symptoms in the week before they died than were other patients.
By contrast, those who prayed or meditated, were visited by a pastor or had a good rapport with their doctor had a higher quality of life, as judged by family members or another caregiver.
"The good news is that these are modifiable factors and not hugely expensive," said Holly G. Prigerson of the Dana-Farber Cancer Institute and the Harvard Medical School in Boston.
"Maybe the best medicine for patients who are dying is developing a therapeutic alliance between doctors and patients - that is, an emotional connection, a feeling that there are shared goals," added Prigerson, who led the study.
The new work adds to a growing body of evidence suggesting that potent drugs and aggressive medical care may end up doing more harm than good for patients with only months left to live. And it's the first study to take a stab at what makes for a good death - or, as the researchers say, the highest quality of life at the end of life.
Prigerson and her colleagues used data from a government-funded study called Coping With Cancer, which followed nearly 400 terminally ill cancer patients from across the U.S. Most were white and Christian, and their average age was 59.
The patients were interviewed when they entered the study and they also completed a questionnaire about their relationship with their physician - including whether they trusted their doctors and felt they were being treated as a whole person. Their caregivers also were interviewed at the outset and again after the death of the patient - on average four months after enrolment in the study.
Based on the caregivers' assessment of each patient's quality of life during their last week, the researchers then created statistical models to see what factors mattered most. (The caregiver's rating of quality of life, on a scale from 0 to 30, corresponded well with the patient's own assessment at the beginning of the study.)
Ending their lives at a hospital or in the ICU was tied to a lower quality of life during the patients' last week, as was having a feeding tube or getting chemotherapy. The same was true for worry at the outset of the study.
Religious activities like praying or meditating, however, were linked to a higher quality of life at the end, as were pastoral care and a sense of "therapeutic alliance."