It's hard to know what to say to a grieving parent. Our own fear of loss can render us immobile. And sometimes people feel like they have to think of the "perfect" thing to say. There is no "perfect" thing to say. There is nothing you can say to heal the grief of losing a child. But acknowledging and supporting grief is a way to help healing. Please know that the effort of talking about the baby, the loss, and the sadness will be appreciated, even if it's not "perfect."
Please do not stay away or ignore the loss. Bereaved parents need your loving support. Not speaking about it does not lessen its reality. Bring up the subject, and be prepared for tears. Nothing you say will ever make the bereaved parent sadder than the reality of losing a child. Simply allowing a safe space for them to grieve without denying that grief is all that's required of you. Remember, it is usually the simple things you say or do that mean so much.
"What Do I Say? Expert advice on helping friends and family cope with the loss of a baby" is a helpful resource for those looking to comfort grieving parents. Healing Gifts and E-cards can help when you feel you need to do more.