What do you do?
Don't tell them it's all in God's plan. It's all in His hands. That very well may be, but your friend just lost his dad/mom/aunt/grandpa/pet/etc. That is not what they want to hear. In fact, they probably don't want to hear anything. They just want a hug. Maybe if you're best friends you can say something like, "This really sucks. I am so sorry," and then hug them. Hugs are good and hugs are required. Just hold your damn friend because their world was just ROCKED.
Another thing. If it's a young girl or boy that has lost someone, DO NOT say something about how well adjusted they are or how they're handling it so well. In fact, even if this person isn't young don't say that. Death sucks and they're not bawling their eyes out because you're there, and most people don't like to show emotions to strangers. They're not crying in front of you because they don't trust you, but they are not well adjusted to this SHOCK and they ARE NOT handling it well. I promise.
DO NOT dismiss their emotions or lack thereof. Death sucks. Losing someone you love sucks. And all your friend wants is your love and support in this shitty time.
[Inspired by this post and my own experience.]