Here's what has helped me.
Firstly, don't say that you "understand how you feel", and don't try to understand, be a friend, be caring, speak when spoken to, answer questions and don't ask too many.
Do nice things if you feel like it, and help for the sake of being helpful, not for brownie points.
And even if you can't help right now, keep them in your thoughts and commit to help the family not just now, but in the years to come.
Oh, and the confusion will continue for a bit, it sucks, but you'll grieve for a while. I've found it best to accept that the situation is shitty, and go through grieving with friends and family at your own pace.