I think you just have to be there to support him and to listen to him if he wants to talk. Often a big hug can speak so much louder than words. There isn't really anything you can say that will make him feel better at the moment, just show your support in other ways - I'm sure he'll appreciate that.
I understand how hard it is for you both; it's hard for him to have lost his gran, and it's hard for you because you care about him, but you can't take away his pain. Time will help, and I'm sure after the funeral there may be a bit of a turning point. Don't rush him, don't let on to him that you feel you're rubbish at dealing with it; you're not, but different people grieve in different ways, so there's no set rules or instructions for you to follow. Show your support, be there for him when he needs you, make it clear to him that you're more than happy for him to talk away to you about it - and if he does, just listen - or if you knew her as well, agree with him and have a bit of a discussion - try and steer him to happy memories.
Take care, and I'm sorry to hear the news.