Is she receiving services from hospice? She should not have to be in pain; The hospice movement perfected palliative care and pain management in the terminally ill more than a decade ago. Does she have access to pain management, or is she refusing adequate pain management under the delusion that it will impair her cognitive function? Does she have the physical support of family?
The most important thing hospice taught me when I worked for them was that terminally ill patients' should never be alone unless they specifically request it, because the diagnosis of a terminal illness is the most emotionally isolating thing a person can experience. You're being there WITH her is encouragement, even if you find it sad. Honesty and openness are important. Don't be afraid to converse with her about the future and ask her what her wishes are with regard to the present (are you thirsty? Can I get you an extra blanket? What would you like to talk about today?). Don't be afraid to let here talk about what might, should, or will happen when she is gone. Don't be afraid to let her talk about how low she feels. Terminal illness makes you helpless. Her talking about offing herself gives her back a small measure of control she feels she has lost. People will do a lot to get out of pain. If she could get her pain under control, she might not think about suicide as a way out, or a way to take her destiny out of the grip of cancer.
Elizabeth Kubler Ross's five stages of grief bears noting: Your friend is probably pissed off beyond measure right now. That makes everything worse for her. Let her talk about it even if it makes you uncomfortable. Ask her if getting her pain under control would make this cross bearable to afford her the opportunity to make the most of her time left. It's not fair that cancer is taking her life, but why let it take it that much sooner? Talking about suicide may be a way for her to vent her frustration and feelings of helplessness. Have you ever felt better after talking about a problem?
Would you want to be remembered when you pass away? Spending time with her is a way to encourage her that she will be remembered fondly. However you can impress upon her that she touched your life and that you will remember her, it will comfort her.
Does she like music? Music therapy can be very comforting. So can the presence of a therapy dog or cat.