I hate when people say, "God answers all prayers. Sometimes the answer is no." I am not completely sure WHY I hate this answer. Possibly because it seems like a cop-out or some kind of defense for God, as if God really needed us to defend His rep. Possibly because I think that if God is real, which I believe He is (and it really doesn't matter what I personally believe, the fact is that He is) & He says He answers prayers, then He should do it. Otherwise, maybe God isn't a god of His word. But I digress.
Here is an answer from Moody Bible Institute's "Today in the Word" (April 22, 2010), that I thought was a great response:
Jesus promises: "Then the Father will give you whatever you ask in my name" -John 15:9-17
The context for answered prayer is God's mission. The Father answers prayers that accord with and are focused upon pursuit and fulfillment of His work. Prayers that are motivated by selfishness are not aligned with the will of God; we should not interpret this verse as a amgic word to get whatever we want. Riather, praying in Jesus' name recognizes His authority over our lives and our desire to live out our calling as His followers.