Good advice so far.
Another really important thing to remember is to keep offering the help you can, and your support, long after the initial shock has passed. So often people will be there initially, but taper off and get back to their own lives, sort of forgetting that this kind of hurt hurts for years sometimes.
Also remember sometimes the best thing you can "say" to someone who has lost a child, is a simple squeeze on the shoulder, a hug, or sitting quietly and honoring the persons emotion by listening.