There are many reasons why prayers seemingly go unanswered. Here are a few:
The person praying, on a deeper level, has decided to go through what h/she is going through so that they can show others that it is indeed possible to rise above what they are experiencing and so it may seem as if the prayer is going unanswered.
The person is not fully ready to transcend his/her current situation that is being prayed for.
The person, when praying, is not wholly focused in the moment and, thus, the powers of the Universe, the Creator, delivers accordingly.
The person does not really want to "heal" from the situation.
The person has not found another way of being and so s/he can not fully transcend the situation.
The person is fearful of moving forward and so holds her/himself back unconsciously.
Prayers ultimately are answered. It is up to us to accept what we are praying for. It sounds silly to believe that we would not want our prayers answered and knowingly hold ourselves back from receiving, but when you are able to see the beam in your own eye you will understand how this is possible.