There are basically four 'problems' for the doctrine of the effectiveness of petitionary prayer stemming from God's alleged immutability, omniscience, moral perfection, and from our own epistemological limitations. The following link is to an SEP article which provides solutions to these 'problems': http://plato.stanford.edu/entries/petitionary-prayer/
The following two articles are referrences in the above SEP article and made available for further reading:
The following two articles are referrences in the above SEP article and made available for further reading:

does_prayer_change_things.pdf |

thepuzzleofpetitionaryprayer.pdf |
Notice that this objection is both in the indicative mood and the subjunctive mood which is formally invalid: If we would pray, then God will answer our prayers; but since God would do His best no matter if we will pray or not, then prayer is useless.
Unlike conditional statements in the indicative mood, the truth value of a subjunctive counterfactual is not a function of its constituent clauses. The counterfactual connective is symbolized with a box and an arrow coming out of the box pointing to the right in order to differentiate it from “→.” This means that although it is a necessary truth that no matter what God would do his best (this is a subjunctive clause that is necessarily true as a whole), it doesn't follow from this that petitionary prayer is useless since the truth value of such statements will be in the indicative mood; meaning that the constituents of such statements are not individually necessary true, although the statement as a whole is. This can be further delineated by answering the following two questions:
(A) Are there goods that failed to obtain that would have obtained had I prayed?
The answer to (A) seems to be no, otherwise God is not doing his best. Were I to have failed to pray for some good(s), God, via His middle knowledge, would have known this logically prior to His decree to create the world, and so might well have decreed to create different persons, or different sets of circumstances wherein some other means brings about the same goods. Hence, if I were not to pray, there might well have been goods realized by others, or by some other means in a different set of circumstances. It must not be forgotten that from the Molinist perspective such affairs are a matter of God's providential planning, not mere happenstance.
(B) Are there goods that have obtained as a result of my praying, that would not have obtained had I never prayed?
The answer to (B) is yes, otherwise prayer is useless. God, knowing via His middle knowledge that I would not have prayed for the goods in question, would not have decreed logically prior to creating the universe that such goods be dependent upon my praying, but would have created a different set of circumstances instead so that the goods that were originally for the best turn out to be no longer required for the best in this different set of circumstances. Thus, if I had not prayed for the goods that I in fact did pray for, the goods I prayed for would not have been realized through prayer, but neither would they any longer be for the best. But then, that means that there are goods that obtain because of my prayer that otherwise would not have obtained, but in both cases god does his best.
Thus, I can rest comfortably in my reflections: I am sure that goods were realized through my prayers, but that no goods would be lost through my slackness.
Here is an illustration of this point: Think about petitionary prayer like answering a question instead of a prayer or a request? Imagine that for some reason I’m about to remind Bill of the time, and just before I speak my friend Craig asks me for the time. What I say is certainly an answer to your question, but I didn’t answer you. That what’s going on with prayer. If a mother prays for god to save some little boy's life, and if god was going to save some little boy’s life anyway, then what he did was answer to the mother’s prayer, but he didn’t answer her.
Some people object to this on the basis that it places god at the level of the natural world; he would be said to answer our prayers only in the sense that the coming of rain answers the prayers of the drought ridden, or the illness of a teacher answers the prayers of a schoolboy who has neglected his homework. The difference must be that god answers us in a personal sense.
However, on Molinism, this is a false dilemma because God can answer us personally through natural events via His middle knowledge. Here is how William Lane Craig puts it, "In order to differentiate between the customary way in which God acts and His special, miraculous action, theologians have traditionally distinguished within divine providence God's providentia ordinaria and His providentia extraordinaria, the latter being identified with miracles. But our exposition of divine providence based on God's middle knowledge suggests a category of non-miraculous, special providence, which it will be helpful to distinguish. One has in mind here events which are the product of natural causes but whose context is such as to suggest a special divine intention with regard to their occurrence. For example, just as the Israelites approach the Jordan River, a rockslide upstream blocks temporarily the water's flow, enabling them to cross into the Promised Land (Josh 3. 14-17); or again, as Paul and Silas lie bound in prison for preaching the gospel, an earthquake occurs, springing the prison doors and unfastening their fetters (Acts 16.25-26). By means of His middle knowledge, God can providentially order the world so that the natural causes of such events are, as it were, ready and waiting to produce such events at the propitious time, perhaps in answer to prayers which God knew would be offered. Of course, if such prayers were not be offered or the contingent course of events were to go differently, then God would have known this and so not arranged the natural causes, including human free volitions, to produce the special providential event. Events wrought by special providence are no more outside the course and capacity of nature than are events produced by God's ordinary providence, but the context of such events, such as their timing, their coincidental nature, and so forth, is such as to point to a special divine intention to bring them about."
Unlike conditional statements in the indicative mood, the truth value of a subjunctive counterfactual is not a function of its constituent clauses. The counterfactual connective is symbolized with a box and an arrow coming out of the box pointing to the right in order to differentiate it from “→.” This means that although it is a necessary truth that no matter what God would do his best (this is a subjunctive clause that is necessarily true as a whole), it doesn't follow from this that petitionary prayer is useless since the truth value of such statements will be in the indicative mood; meaning that the constituents of such statements are not individually necessary true, although the statement as a whole is. This can be further delineated by answering the following two questions:
(A) Are there goods that failed to obtain that would have obtained had I prayed?
The answer to (A) seems to be no, otherwise God is not doing his best. Were I to have failed to pray for some good(s), God, via His middle knowledge, would have known this logically prior to His decree to create the world, and so might well have decreed to create different persons, or different sets of circumstances wherein some other means brings about the same goods. Hence, if I were not to pray, there might well have been goods realized by others, or by some other means in a different set of circumstances. It must not be forgotten that from the Molinist perspective such affairs are a matter of God's providential planning, not mere happenstance.
(B) Are there goods that have obtained as a result of my praying, that would not have obtained had I never prayed?
The answer to (B) is yes, otherwise prayer is useless. God, knowing via His middle knowledge that I would not have prayed for the goods in question, would not have decreed logically prior to creating the universe that such goods be dependent upon my praying, but would have created a different set of circumstances instead so that the goods that were originally for the best turn out to be no longer required for the best in this different set of circumstances. Thus, if I had not prayed for the goods that I in fact did pray for, the goods I prayed for would not have been realized through prayer, but neither would they any longer be for the best. But then, that means that there are goods that obtain because of my prayer that otherwise would not have obtained, but in both cases god does his best.
Thus, I can rest comfortably in my reflections: I am sure that goods were realized through my prayers, but that no goods would be lost through my slackness.
Here is an illustration of this point: Think about petitionary prayer like answering a question instead of a prayer or a request? Imagine that for some reason I’m about to remind Bill of the time, and just before I speak my friend Craig asks me for the time. What I say is certainly an answer to your question, but I didn’t answer you. That what’s going on with prayer. If a mother prays for god to save some little boy's life, and if god was going to save some little boy’s life anyway, then what he did was answer to the mother’s prayer, but he didn’t answer her.
Some people object to this on the basis that it places god at the level of the natural world; he would be said to answer our prayers only in the sense that the coming of rain answers the prayers of the drought ridden, or the illness of a teacher answers the prayers of a schoolboy who has neglected his homework. The difference must be that god answers us in a personal sense.
However, on Molinism, this is a false dilemma because God can answer us personally through natural events via His middle knowledge. Here is how William Lane Craig puts it, "In order to differentiate between the customary way in which God acts and His special, miraculous action, theologians have traditionally distinguished within divine providence God's providentia ordinaria and His providentia extraordinaria, the latter being identified with miracles. But our exposition of divine providence based on God's middle knowledge suggests a category of non-miraculous, special providence, which it will be helpful to distinguish. One has in mind here events which are the product of natural causes but whose context is such as to suggest a special divine intention with regard to their occurrence. For example, just as the Israelites approach the Jordan River, a rockslide upstream blocks temporarily the water's flow, enabling them to cross into the Promised Land (Josh 3. 14-17); or again, as Paul and Silas lie bound in prison for preaching the gospel, an earthquake occurs, springing the prison doors and unfastening their fetters (Acts 16.25-26). By means of His middle knowledge, God can providentially order the world so that the natural causes of such events are, as it were, ready and waiting to produce such events at the propitious time, perhaps in answer to prayers which God knew would be offered. Of course, if such prayers were not be offered or the contingent course of events were to go differently, then God would have known this and so not arranged the natural causes, including human free volitions, to produce the special providential event. Events wrought by special providence are no more outside the course and capacity of nature than are events produced by God's ordinary providence, but the context of such events, such as their timing, their coincidental nature, and so forth, is such as to point to a special divine intention to bring them about."