It's always struck me as weird, this concept that people will "Pray for you" when something bad happens. As an agnostic, of course, I don't have that to say, but it's such a phrase that I am not sure I would have used it anyhow.
When you hear about something horrible that happened to another person, your urge to express sympathy is strong. When you're talking in person, you can reach out to the other person and offer them a hug, or at least your face will reveal the extent to which you really feel for the person. And let me repeat, the willingness to give a hug, even if you're some big huge guy and talking to some tiny woman whom you might intimidate, but you totally understand the grief she's feeling and you're willing to help out as you can. "I'm so sorry, lady, I am normally not a huggy sort of guy, but you seriously look like you need a hug, this thing you've told me is a horrible thing, and I want you to feel better."
The brain struggles with it in person just enough, but your physical presence gets across that "I feel bad." And you feel like you're helping somewhat.
But when you're talking textually, there's nothing like that. And "I'll pray for you" has always stood in for other people, or some other form of offering to speak to the Almighty on the behalf of the suffering.
It's not as if there's some sort of voting process, and adding your vote will somehow make their plight more noticeable, and somehow it'll get to the top of the queue of "things to fix."
So, why do the religious use this as a sort of empty condolence?
And ... like I said, us agnostic folks don't even have that. I think the best thing we've got is "I'm sending along virtual hugs." (Which has the advantage of being less threatening to folks who might not want a hug from Hagrid.)
My brain has too many random anxieties to offer proper condolences to people, and I struggle with all of the "I don't want to offend" and I might get that "virtual hug" comment, but generally I just offer the two words "My condolences" which sounds cold, and doesn't express the "I'm so very sorry for you" but has the advantage of not intruding my own mental confusion onto their situation.
Or you can step away and say nothing if it's a public enough environment online. The advantage of public conversations is that your absence won't be interpreted as a statement itself.
Still, you do want to say something, and "I'll pray for you" had the advantage of being something.