Was there any hope in this situation? There was no way Peter could escape by his own power. We know that God had further plans for Peter's life, among them the writing of scripture! But could God really save him? The guards, Herod, the executioner - if their "free will" was really driving the situation, could God step in? He did, and in a miraculous way!
"And behold, an angel of the Lord suddenly appeared and a light shone in the cell, and he struck Peter's side and woke him up, saying, 'Get up quickly.' And his chains fell off his hands." (Acts 12:7)
The angel leads him past the guards, through the iron city gate, and departs as they're going along one street. My favorite part of this account is when Peter arrives at the house of Mary, the mother of John (also called Mark) where a major prayer meeting is being held for him. When the servant girl hears Peter's voice at the door and reports it to the crowd, they at first don't believe her! (Aren't we often the same way in doubting that God will answer our prayers?) I can imagine what kind of rejoicing went on in the house that night!
So what truths can we take away from this story? A couple that stood out to me are:
1) God is in complete control of every situation. No one can thwart His plans for our lives.
2) The above truth does not mean that God's will is always for our comfort, ease, or deliverance - Peter was released, but James was allowed to be put to death. However, we can trust God in what He allows, knowing He is in control and His plans are perfect. (Romans 8:28 comes to mind.)
And maybe one more point for application: If God can miraculously send an angel to loosen Peter's chains and lead him out of a prison cell, is He not capable of ordering even the smallest events of our lives?