There is some evidence that prayer works (PW)—and I mean this in the straightforward naive sense. Here is that evidence: Lots of people believe that prayer works (BPW). It is more likely that lots people would believe that prayer works if it worked than that they would believe that it works if it didn't work, i.e., P(BPW|PW)>P(BPW|~PW), and so BPW is evidence for PW.
There are at least two reasons why people are more likely to believe that prayer works on the hypothesis that it actually works than on the hypothesis that it does not work.
The first reason is that if prayer works for you, then that's likely to increase your degree of belief that prayer works, as well as the degree of belief in this among your friends.
The second reason is that if prayer works, then that's likely to increase the survival of communities that pray, leading to mimetic selection for prayer. And at the community level, prayer typically doesn't come for free. First, there tends to be a dedicated class of people who pray and teach how to pray—say, a clergy. Second, prayer is often attached to material outlays, whether those of sacrificing cattle or of building temples. Third, prayer takes time and maybe mental energy (though the last one is balanced by the fact that it may be restful). Of course, prayer may also have community cohesiveness benefits independent of whether prayer works in the naive sense. These benefits may be balanced by the costs. But these benefits are also available if prayer works in the naive sense, and are themselves accentuated then (it brings a community together if their prayers are fulfilled). So although the existence of such benefits makes P(BPW|~PW) higher than we might otherwise think, nonetheless P(BPW|PW) will be even higher, both due to a greater degree of these benefits, and due to the obvious benefits of prayer working.
Of course it's a hard question to say just how much evidence the widespread belief in the efficacy of prayer provides for that efficacy. But it's clear that it provides some.