Whether a god who listens to prayers exists, is not known. But what is known is that the probability of such an existence cannot be proven to be zero.
Hence, if somebody is in a major peril and can in no active way solve their problem, why is it considered irrational to pray?
Is it not completely rational to at least try and pray, in the odd case that such a god does happen to exist? Even if the probability of such an existence is 0.000000000000000005 %, that's still not zero.
So, why is it considered irrational, when it can effectively just be seen as somebody taking advantage of a non-zero probability? It's like a free lottery ticket. Why would it be irrational to take a free lottery ticket?
Another argument is that if God did exist and wanted to answer your prayer, then God wouldn't let it happen in the first place. I think this is an interesting debate, but ultimately one which depends on extra assumptions, such as what the purpose of life is, whether there's a thing such as destiny, whether good is moral, whether god is omniscient but not omnipresent (and thus a prayer would be a way to get God's attention), etc etc.