When a customer comes into my work and has just gone through a terrible crisis, I usually feel obligated to say some stupid thing like "I hope everything goes as well as it possibly can" even though I know my words really don't help. I feel like a jerk if I don't let them know I hate that they're suffering, even if I don't know them well or at all. It's hard to come up with soothing words, and saying "I'll pray for you" might be the only words that come to many people's minds. If very many people react to crisis situations like I do, they're at a loss for words.
Hearing "I'll pray for you" over and over does get plenty irritating, too, however well-meaning the folks saying it are. To answer the original question, a half-hearted "thanks" is an easy reply.
But like I said before, a good friend might annoy you with that phrase, but he also offers to help you out.