Quoting Dr. Paradigm Shift:" The "no atheists in foxholes" is kind of silly to me. And actually super condescending. It reeks of ... [snip!] ... know what I do and don't believe in. I quoted you because you brought up the phrase- this wasn't directed at you, by the way."
I said it wasn't always true. And I think the phrase rarely goes to true belief. However, at wits end, people are usually willing to give almost anything a shot. At times of extreme stress people both lose faith and find faith. It's a time when what you're doing may not work so you try somethign else. Sending up a "please God" can't hurt an Atheist and when you're out of options it's something people try.
I don't think it's condescending at all. I think it's human nature. Most smart people will admit that we don't know everything. I may have faith, or lack of faith, but at the end of the day I lack all the answers. So when stress is high we often had to admit to not knowing. This can mean losing faith in those who believe, or even giving a prayer a chance in people who don't.
That's how I see the quote at least.