What a horrible tragedy for everyone involved.
There are no answers to something so devastating.
I do not know about the power of prayer, but when it is someone you love and there is nothing else to do, you pray as hard as you can.
If he survives, and we all hope he does, he will need your friendship more than anything else. His life has been completely changed, but the love of his family and friends will help him to see the value of life and keep the will to go on.
Do not blame yourself in anyway or have regret for not seeing him that afternoon.
If he does not make it you can honor that missed last chance by supporting his family through the horrible pain they will go through for years to come.
Talk to your family and those you respect and care for, about what you are going through. You are going through a horrible experience and need the love and support of those close to you.
Pain like you are feeling can be reduced a little when it is shared.
I will say a prayer for your friend, his family, and for you.