The Mishnah reports that Rabbi Hanina ben Dosa knew whether a prayer for the sick would be answered.
They said concerning R. Hanina b. Dosa, "When he would pray for the sick he would say 'This one shall live' or 'This one shall die.'" They said to him, "How do you know?" He said to them, "If my prayer is fluent, then I know that it is accepted and the person will live. But if not, I know that it is rejected and the person will die." (m. Berachot 5:5)
The sages of the Talmud provide the context for this. Rabban Gamaliel's son fell ill and he sent two scholars to R. Hanina to seek Divine mercy for him. After praying (in his attic), R. Hanina told the scholars to return, saying, "Go, for the fever has left him." They asked him, "Are you a prophet?" and he replied in words borrowed from Amos 7:14, "I am neither a prophet nor the son of a prophet." He goes on to explain that he has a tradition that if his prayer is fluent in his mouth - that is, the words come easily and the thoughts flow - then the prayer has been accepted and will receive a positive response, but it not, then the prayer has been rejected and although heard, will not receive a positive response. (b. Berachot 34b)
What are we to make of this? Can we presume from this to know whether our prayers for the sick have been effective (or not)? Can we extend the principle to prayer for other circumstances? How does it interact with Yeshua's promise that "Whatever you ask in prayer, believe that you have received it, and it will be yours" (Mark 11:24)?
Promises about prayer have always given believers trouble. The fact is that we pray about a good many things and, apparently, on the surface, many of them do not appear to have been heard and do not receive either the answer we were looking for or, in some cases, any answer at all. On the one hand, Yeshua's words in the gospels - and the tenor of Rav Sha'ul's letters - seem to offer a certain level of guarantee, and on the other hand, the evidence all around us suggests that although some prayers are answered quite spectacularly (and Baruch HaShem for that!) many are not. I don't think that trying to rationalise this on the basis of good or bad prayers, prayers in line with the Divine will (or not), or having enough faith (or not) really help.
Let's get a couple of things straight. Firstly, I don't think there is ever such a thing as an unheard prayer - all prayers are heard. Secondly, I believe that something happens whenever people pray - it may or may not be a visible something and we may or may not be aware of it, but something about the people or the situation changes because we have prayed. Thirdly, we change because we have prayed - as a secondary effect of prayer, we are changed in some way because we bothered to engage with the issue, to express concern, to frame and make a prayer. Fouthly, I believe that every prayer is answered, but we'll need to unpack that a little.
Answers to prayer? This may sound hackneyed, but 'yes', 'no' and 'wait' are the answers. Some prayers are positively answered: the person offering the prayer may or may not feel 'good' at the time, but there is a visible response or action that comes from the prayer. Some prayers are negatively answered: the one praying may or may not feel 'not good' at the time, but there is no visible response or action that follows the prayer.
Most often the answer is 'wait'. This is not the same as the answer many parents give their childern, 'may be', which simply means "Go away, I'm busy right now and don't want to think about it." 'Wait' means that for one reason or another, which we may or may not get to find out about, this is not the right time for the answer. Something else may need to happen, someone else may need to become involved in some way, or as in the case of of the Promised Land, "the iniquity of the Amorite is not yet complete" (Genesis 15:16, NASB).
Coming back to Rabbi Hanina, I think it is perfectly possible that the Ruach whispered how to pray to Rabbi Hanina in the same way that He whispers to us when "we do not know how to pray" (Romans 8:26). That makes prayer flow or struggle. It is difficult to be ferevently fluent against the guidance of the Spirit and without the spiritual lift He gives. Equally, we must always engage with prayer and ask big things of our G-d, even if we have no immediate assurance that He will respond.
Therefore, also I believe that we can and should seek the gudiance of the Ruach ourselves in every matter about which we pray. Before praying about the matter in hand, we can always pray under our breath and ask, "How do you want me to pray about this matter?" Then we go ahead and pray, trusting that He wull guide our words and requests. This is consistent with Yeshua's teaching because He said that the Ruach would teach us all things and remind us of Yeshua's words.