Let's say there are two ways of dealing with this:
Your friend says: "Please, pray for me... I hope everything will be OK.".
You say: "Such a poor person... I hope and I pray that he will make it through and ...".
It has nothing to do with the physical and ceremonial praying part.
It stems from Compassion and Kindness.
Regardless of which cases as mentioned above, your Compassion would reflect your action, not just towards the person who, before your eyes, is in need, poor, and in unfortunate situation, who you "directly" help (pray for).
It doesn't mean you would heal him or solve his problem at an instance (i.e. you become a doctor and heal him).
Instead, it goes further than that:
Your Compassion would be reflected in every little action that you have towards those in need, even if they may be trivial - it may be as simple as a smile; sharing your meal and bringing it to the neighbor, whose immobility affects his ability to cook / buy food; taking a little time even after a long day at work to speak with someone who is sick but has no-one to talk to but you take a little time even after a long day at work to speak with him; etc etc.
Along the journey, one might learn something from it as well and acquire more Compassion; a funny example:
You decide to go do some errand for this poor neighbor of yours, who is immobile due to sickness. At this supermarket, you happen to see some people standing outside of it, talking loudly and bothering passersby with their words. You are infuriated, and as strong as you are you could physically harm these "bad" guys with your might and teach them a lesson. But you didn't. Why? If it suddenly occurs to you that harming these people would put them in a situation just like your poor neighbor, your Compassion channels through, namely more than just caring for the neighbor - your Compassion becomes vast and endless and unbiased.
Through these actions, you part gradually from the "self":
"It is your problem, why me praying for you, for your karma?"
"Hey, I will try my best, but you gonna do your part"
Once the above reactions are no longer present in your mind as you help, your Compassion has arisen purely and it is no longer about "I" and "you".
Through the experiences of helping others though Compassion, one may learn as well - one would learn how to observe unbiasedly over time, and because of this, one's help to others would become selfless and truly beneficial to those in need.
Not just because "I feel great and better as a person, because I help."
Because if we do, it would be about our ego. The help to others would be about us, ourselves.
Thanks for question.