When my Dad was dying, I wrote letters to Archangel Azrael--the angel of death. I asked him not to take my dad before his time. And if that time was around the corner, I asked him to help him make this transition without causing him too much pain. I asked him to comfort my mother and the rest of my family. Dad was the head of my family, the decision maker, the go-to person. It wasn't easy to watch him suffer and see him go. And I know it isn't easy for you to watch your grandma go either. She's probably been a figure of unconditional love, compassion and comfort to you.
Dad was a religious man. Painfully orthodox at times. And even though I'm not a "praying kinda person", I would hold his hand and pray out loud, especially when he started hallucinating. It would calm him down and strangely it would calm me down too. In his last 3 days, we got a priest to pray by his bedside. What I'm trying to say here is, do everything that you can to bring comfort to your grandma. If religion is not her scene, stroke her head, read or sing or just talk to her. Even if she doesn't seem to be responding, she can still hear you and understand you. Don't forget to tell her that you love her and always will love her. Let her know that you're gonna be ok and most importantly tell her that this pain will be over soon.
Another thing that helped me is knowing what to expect. I've never had anyone this close to me die before. So I needed to know what was happening to my father. A couple articles I read helped me put things in perspective. Thought I'd share them with you:
If she hasn't reached this stage yet and you guys have some time with her, then make the most of it is all I can say.
I wish you and your family strength to pull through this. It will probably be the toughest thing you've had to deal with. But even in the worst of times, remember that this too shall pass.