My thoughts and prayers with your friend and his family in this hard time. There is saying like one could double the happiness and make half the pain and sorrow if they share it with others. So you must be little relieved after you sharedit here. And at the same time it is also the most cruel punishment one can get it one gets to live the life with the pain of losing their kids for the rest of life.
We can hope time may heal their pain to a limit. You can give as much as comfort to them by frequent visits and doing like what you had exactly done try to divert their thoughts as much as they can.
RIP for their soul.
There is also another saying God used to take back people whom He likes most from this earth.
So the girl must be God's favorite little kid. The world is cruel, We have to expect the unexpected many times.
I wasn't able to fall asleep last night and writing that allow me to get to bed. It was therapeutic for sure and helps show that just being there to listen to others can help lift their burdens.