I recently finished Tim Keller's Walking With God Through Pain and Suffering - a book I highly recommend for those who pray for and with the suffering. I'll post a review on the book soon. The next to last chapter had some thoughts on Philippians 4:6-7 that have stuck with me, and I'll try to do them justice here.
Keller makes the point that the "prayer with thanksgiving" that Paul talks about in Philippians 4:6 is different than the way we tend to think of it. We tend to think of thanksgiving in terms of thanking God for what he has done; in the context of prayer, thanking him for how he has answered prayer. But Paul's actual instruction is different. Rather than waiting for God to answer prayer and then thanking him, Paul tells us to pray and thank God at the same time.
So what are we thanking him for, if we haven't yet received the answer? This isn't thanksgiving that presumes that God will do exactly what we asked - this is thanksgiving that recognizes that God is in control and that expresses gratitude for his intervention in our lives. It's thanksgiving that is answer-agnostic; that is, it's thanksgiving that doesn't know how God will answer this particular prayer, but that recognizes that he acts always for our best in the context of his glory. We thank him for what he has done, but we also thank him for what he is still going to do.
I can't help thinking of a couple of other passages in this context. Hebrews 11:6 tells us that "without faith it is impossible to please God, because anyone who comes to him must believe that he exists and that he rewards those who earnestly seek him." I've usually thought of these "rewards" in somewhat of an abstract sense but I now think of them more concretely. Faith isn't just believing that God will answer prayer but that he actually is answering prayer. We're not waiting for God to work; God is actually working - and the time that seems to us like just waiting is really part of the work that God is doing.
Similarly, James 1:6 tells us that when we ask we must believe and not doubt. I think the "belief" that James is talking about is more than just belief in God in general - it's belief that he is answering our prayer (specifically in this case, a prayer for wisdom).
Coming back to Philippians 4, I think that the kind of thanksgiving that Paul is talking about - the kind that's not based on receiving a specific answer but that rather is based on our confidence in God's character and his love for us - helps us to recognize answers that are for our best. (An example of this is 2 Corinthians 12:9) This, I believe, is the secret to the peace that transcends understanding. Prayer that's focused on receiving a specific answer doesn't bring peace - it brings uncertainty. Will I receive the answer I want or not? How many times I have prayed but not experienced peace - because my prayer was all about a specific answer and not about trusting God for the answer. But the prayer with thanksgiving that Paul talks about here really does lead to peace, because it enables us to pray and leave it in God's hands, rather than continuing to wonder and worry how he will answer.
So I'm learning to try to hold my desired answers with open hands, and to thank God for the work he is doing - work that he will reveal to me at the time he knows is best. And I'm experiencing peace by relinquishing my need to have things work out exactly the way I want them.