I'll break my self-imposed isolation (coz I'm writing my novel) to reply to this thread.
First, there are times that just being there helps. Your friend needs someone to support him in his moment of grief, and you coming over to his place speaks a lot already about your relationship with him. Yes, we may feel inadequate at the present situation, but regardless of what you said to him, he'll appreciate the time when you are with him when he was at his worse.
Second, what you said to him is the usual words people would ask whenever they were shocked as well. And in his moment of grief, your friend may have already forgotten about it. Another related thing is, if you say you're friends with him for a long time, it's obvious that you guys already know each other. End of my point is, since you guys are together for so long, it's obvious that you mean no harm when you asked those questions.
Grief and depression are conditions that are difficult to deal with, especially if the ones affected are your friends. However, just showing that you care for their struggles is already big enough to show that you love them, and you stand by them. There's nothing much you can both do, other than let time heal the pain of loss.
What's important is that you guys stay together through thick and thin.
I'll now scoot back to my self-isolation. My condolences to his mother, and I applaud your faithfulness to your friend. In these times, there are only a few people left with that kind of virtue.