Dear C.,
I also had a daughter die at 3 months old, but she was able to be at home with us the whole time. From my perspective, there are a few things you can do to help. Saying you understand or that you're happy the baby is in a better place are NOT good things to say. Saying "I love you" and "Would you like to talk about her today?" are really good things. But remember, saying something stupid is SO much better than saying nothing at all. You are a great friend just for sticking around through her pain.
Also, I really appreciated when people would offer to help with my older child, make a meal for us, or help with housecleaning. Your friend is busy grieving full-time right now, and all other things tend to fall by the wayside when you're that busy with your grief.
As time heals a little bit and your friend becomes more able to cope with life in general, the thing that she'll probably need most is the opportunity to share about her baby's life OVER and OVER. You may know everything she's saying inside and out, but the therapy is in being able to tell her story and keep her little one present in her life. If you'd like, I'm completely willing to give you my e-mail address if you have more questions in the future. Please know that my prayers are with your friend and her family.