When someone has lost a child, the best expression of sympathy is often a simple, heartfelt "I'm so sorry," according to About.com. You can also, at a later time, offer your personal fond memories of the deceased child.
Family members of a deceased child also appreciate offers of help, from a hug to a meal to helping with the care of other children. Moving forward, continue to remember the child's birthdays and special anniversaries.
Things not to say include "It was for the best" or "Your child is in a better place." Also, never impose a timeline on parents' grief or expect them to "get over" the death of their child.