Protection spells. It is a belief that has strangely stopped being passed down that there are certain spirits that specifically feed off of illness and death. They will make a death far more painful and miserable. This is why most death happens at night, when the spirits of the lower world more freely roam. French hospitals used to burn frankincense to keep away demons of illness. The medicine man in many Native American tribes would sit standing vigil over the ill and dying to keep away those that would prey on them. As soon as anyone takes to illness in my family, I was taught that one must immediately cleanse/clear the area and them and protect them with everything you have. And if you can't handle it, you need to research and find out what beings you can trust to help you out. But realize it isn't their fight. They don't care. It is your job (if you take it) so be sure you use them as aid not a crutch.
Even the common cold can kill someone as it develops into something worse. Prevention on a spiritual level can and does help on a physical level at every stage. It should be used no matter how small the injury or illness. Do NOT heal the illness if the person is dying. You will prolong their suffering. Heal their emotional and mental well being so that they find peace and acceptance in the inevitable.
And yes, as the other person stated, being there for them is also necessary. Gentle touch and sound is very therapeutic.