K.Z.
Oh, how very sad!
You can always say "I am so sorry you are going through this tough time" or something like that. It is also ok to say "I really don't know what to say". I do feel it is important to say something, though, rather than ignoring it entirely (but I don't think you were going to do that). Trying to say the right thing and failing is much better than not trying to say anything at all.
Others have made good suggestions (food, housecleaning, errands, watching other kids, toy for baby etc). Cards are sometimes helpful as well, even though a "Get Well" card may not be appropriate, a "Thinking of You" one might.
And after the baby dies, don't be afraid to talk about him and mention him by name; they will be glad you remember him too.
K. Z.