Let them know that you are sorry for their loss, that is the best thing you can do. I lost twin girls, they were stillborn, and the worst things someone told me (the same person) was that I could try again (as if I could make up for them!) and that it was all for the best...I know what she meant but still after all these years a part of me wants to ask her, "Excuse me, who's best?" I know this family is devastated, they already had hopes and dreams for their child that can never be fulfilled.
Just to be there if they need to talk or cry is a help. Take a meal over, buy some food for the house, clean up the house or the yard, whatever you see needs to be done. The holidays will be hard for them, if your family plans any activities try to include them.
Thanks for caring for your friends!