The Bible nowhere guarantees God will answer every prayer in the exact way we expect Him to. This argument merely assumes how God should respond to prayer, rather than what the Bible says about how God responds to prayer.
Some argue that Christianity cannot be true because prayer does not work. Bill Flavell, in his article, "Eight reasons Christianity is false," says this:
There is clear evidence that prayer does not work despite the Bible promising prayers will be answered.
This argument rests upon the premise that the Bible promises that prayers will always be answered because if the Bible teaches that God sometimes chooses not to answer prayers, then the argument completely falls apart. People who make this argument must demonstrate that the Bible actually etaches that prayers will always be answered, which, of course, they simply cannot do.
Here, we will answer this argument by doing two things:
The Bible teaches that God answers prayers that are "according to his will" (1 John 5:14-15
For example, in 2 Corinthians 12:8-10
8 Three times I pleaded with the Lord about this, that it should leave me. 9 But he said to me, “My grace is sufficient for you, for my power is made perfect in weakness.” Therefore I will boast all the more gladly of my weaknesses, so that the power of Christ may rest upon me. 10 For the sake of Christ, then, I am content with weaknesses, insults, hardships, persecutions, and calamities. For when I am weak, then I am strong.
However, even though God did not answer Paul's prayer directly, God answered Paul's prayer in that Paul realized that it was for God's glory that God did not heal him. By not healing Paul, God helped Paul to depend more upon Him and to find contentment even in pain and weakness.
14 And this is the confidence that we have toward him, that if we ask anything according to his will he hears us. 15 And if we know that he hears us in whatever we ask, we know that we have the requests that we have asked of him.
Some argue that this passages teaches that God will answer "anything" that we ask of Him. However, this is clearly not what the passage says. This passage says that if we ask anything "according to his will", God will hear us.
We have already demonstrated that it is not always God's will to answer our prayers in the exact way that we might expect or desire. Sometimes it is God's will to answer our prayer by not answering our prayer directly, so that we will depend upon Him more, which glorifies God and should bring a sense of joy, peace, and contentment to us. It is oftentimes through suffering that we grow the most in our relationship with God.
If you abide in me, and my words abide in you, ask whatever you wish, and it will be done for you.
Some argue this passage says that if we ask whatever we wish, God will grant that wish to us. However, again, this is clearly not what this verse is saying.
This verse says that if we abide in Christ, and Christ's words abide in us, then God will grant what we ask. If we are truly abiding in Christ, and Christ's words abide in us, the things we ask for will be according to God's will, as mentioned in our commentary on 1 John 5:14-15
The argument that Christianity cannot be true, or is most likely not true, because "prayer doesn't work" is an absolutely terrible argument that does not even begin to succeed. It assumes something completely false about what the Bible teaches.
The Bible is completely consistent in what it teaches if we simply study it. This kind of argument against the Bible is ignorant and superficial, and Christians should not be afraid to label it as such.
Of course, it can be emotionally painful for prayers to not be answered, but this is not an argument against the Bible. We should empathize with those who experience pain and suffering without direct relief, and we should point them towards the God who has provided eternal hope for His people through the suffering and death of His only son, Jesus Christ.
Through Jesus, we can trust that no matter what we are going through, we know that God is in control and that He deeply cares for His children. The atheist worldview can provide no such comfort.