This is a challenge that I have heard put against practicing prayer many times. It is also used to imply that God either cannot hear our prayers, or does not care about us (thus He is not all-loving).
Simply put, this claim is the result of the person claiming it "forming God in man's image". The person has a specific idea of what God is supposed to be. Many sources exist to arrive at this conclusion. Someone might have told him to believe that if he prays for healing...POOF! He's healed! A church may have taught him that God wants his people to have the very best (referring to material possessions, of course). "God, please let me win the lottery." Have you ever seen the movie Bruce Almighty? :) Watch it and you'll know what I'm talking about.
The thing about God is that He made us in His image, not the other way around. Man is impatient, greedy, and selfish. Many times, God answers your prayer, not how you think it should be answered, but how He knows it should be answered, and when. For instance, I have a friend that has been wheelchair bound for several decades. This person asked for healing from God, and she believed with all that her heart that God would do it. Years passed, but she was not healed. Later, she realized that God had other plans for her life. She has been a tremendous witness for Christ. Specifically she has the ability to testify that God will never leave nor forsake us when we are going through suffering. She can testify that God makes drastic changes in our lives to drastically change us, for the better.
Let's think about this for a minute. If God was to give us the $200 million lottery ticket like we prayed for. Would that make us feel more dependent on Him or less dependent on Him? Many times God gives us a resounding "NO!" to teach us to be more like Him and depend more on Him.
God also has perfect timing for everything. You might be in a painful situation that you have not been delivered from. God could be biding his time, waiting on you to acknowledge and change something that you haven't yet, and may not have even considered if the pain was not there. God may also be leading you down a different path in life.
Either way, while we are suffering, we can know that God is there, and we should use the situation to the best of our abilities to discover new (possibly temporary, possibly permanent) ways to serve God.
Remember that your prayers are never unheard, and they are never unanswered. God just might be doing something that you don't expect. As we strive to be more like Christ and draw nearer to Him, we will be able to see more clearly what He has planned for our lives. As this happens, we will be able to be a witness to others in the same situation.
I have posted more on the topic of suffering in my posts "Suffering Sucks...or Does It?" and "Natural Evil".