Your grandfather in the hospital is not because of bad karma. It is because of the aging & decaying of the physical body. The Blessed One declared:
All that is dear & beloved there must be change, separation & severance. Of that which is born, come into being, compounded & subject to decay, how can one say: 'May it not come to dissolution!'
Mindful and clearly comprehending, reflect in this way: 'Impermanent are all compounded things. How could this be otherwise?'
Maha-parinibbana Sutta: Last Days of the Buddha
Buddhism states, even when there is death, the good karma a person has done will bring good results & the bad karma person has done will bring bad results. Therefore, when your grandfather is in hospital, you should think about the good karma your grandfather did in his life. To quote:
These beings — who were endowed with bad conduct of body, speech & mind, who reviled noble ones, held wrong views and undertook actions
under the influence of wrong views — with the break-up of the body,
after death, have re-appeared in the plane of deprivation, the bad
destination, the lower realms, in hell.
But these beings — who were endowed with good conduct of body, speech & mind, who did not revile noble ones, who held right views and
undertook actions under the influence of right views — with the
break-up of the body, after death, have re-appeared in the good
destinations, in the heavenly world.
Bhaya-bherava Sutta: Fear & Terror
If your grandfather dies, you must think about his good karma and you must make merits & dedications for him. The scriptures state:
In five ways, a child should minister to his parents:
(i) Having supported me I shall support them,
(ii) I shall do their duties,
(iii) I shall keep the family tradition,
(iv) I shall make myself worthy of my inheritance,
(v) furthermore I shall make offerings in honor of my departed relatives.
Sigalovada Sutta: The Layperson's Code of Discipline
In conclusion, the only bad karma that is occurring is your not having right view in the mind about the Dhamma. Even if your grandfather in hospital causes you grief & sadness, as a Buddhist, you must also have Dhamma in your mind, as the Buddha taught, as follows:
There are these five facts that one should reflect on often, whether one is a woman or a man, lay or ordained. Which five?
1. 'All are subject to aging. Have I gone beyond [am I peace with] aging?
2. 'All are subject to illness. Have I gone beyond illness?'
3. 'All are subject to death. Have I gone beyond death?'
4. I will eventually be separated from all that is dear and appealing to me.'
5. 'I am the owner of my actions, heir to my actions, born of my actions, related through my actions and have my actions as my arbitrator. Whatever I do, for good or for ill, to that I will be the heir.'
Upajjhatthana Sutta: Subjects for Contemplation
Click here for Alternate translation.