This, I think, is one of those things that hangs on which side of the theism-atheism divide you are.
Theists presumably think that prayer 'works' in some manner or other, though what constitutes 'working' - perhaps conveniently - remains a vague and nebulous thing consistent with absolutely all, any and every state of affairs, such that it is unfalsifiable and therefore absolutely and utterly useless as a working hypothesis. What I actually think, but do not say, when I read the prayer thread here would undoubtedly earn me an instantaneous and lifetime ban.
Atheists hold that the only benefit of prayer, if any, is a psychological one akin to the placebo effect in the mind of the individual prayee. One might, if uncharitable, call it a sort of spiritual masturbation - a solitary activity that gives the individual personal pleasure for a few minutes, but no more than that.
When Christopher Hitchens was dying of cancer he graciously took on board the first viewpoint while being resolutely convinced of the latter. That, in the name of good manners, is a tolerable compromise, surely. Where this crumbles is the sort of faux-concerned but actually passive-aggressiveness that you see sometimes.