Claudius meets with Rosencrantz and Guildenstern. Claudius says Hamlet's clearly crazy, and it's unsafe for him to stick around Denmark – the crazier he gets, the greater the threat to the throne. Instead, he'll be sent to England along with Rosencrantz and Guildenstern.
The two young men say this is fine by them, as they're happy to do anything for the safety of the King. Rosencrantz even goes on in a sickeningly fawning speech about how the King's needs are more important than lesser people's needs.
It's such a bad speech that even Claudius has to cut him off, with a little bit of: "Go get ready to travel now, so we can contain this fear." He's talking about his own fear that he'll be found out for murder and that Hamlet will come and get him.
After Claudius finally gets rid of Rosencrantz and Guildenstern, Polonius shows up to make a report. He says he's off to hide himself and eavesdrop on Hamlet's conversation with Gertrude.
Polonius also fawns over the King, saying it was wise of Claudius to suggest that someone listen in on this conversation, as moms tend to be biased when judging their children.
Polonius promises to report what he learns of before he goes to bed.
Claudius, finally left alone, admits to murdering his brother, an act which carries with it God's curse (as in God's curse against Cain for killing his brother Abel).
Claudius tries to pray, but can't bring himself to do it.
He asks if there isn't rain enough in the heavens to wash his hands clean of his brother's blood. (This is kind of like when, in Shakespeare's Macbeth, Macbeth notes that the whole sea wouldn't wash his hands of Duncan's blood.)
Yet, Claudius reasons, isn't this what prayer is for? Mercy can only be merciful if faced with the worst offenses. Further, prayer should be used to stop us from doing bad things, and should also come in handy for pardoning us when we've done bad things.
Given some time to think about what he's done, Claudius reasons with himself. He can't ask for forgiveness for the murder, as he still has all of the gains he got from committing it (that would be the crown, unsullied ambition, and access to the Queen's private lair). Even if on earth, the elite could get by with that kind of tomfoolery, there's no such privilege for the rich and famous in Heaven.
Claudius really lays it out here about how much he's suffering, especially about how it's so hard to be the King and enjoy his dead brother's wife.
Finally, Claudius gets it together enough to kneel and pray.
Hamlet enters and raises his sword.
But then Hamlet realizes that if Claudius dies while praying, the man will go to Heaven. (Some historical context: It was very important in Shakespeare's time for Catholics to be absolved of their sins by a priest or prayer before they died. If they did not, they would have to suffer in Purgatory, like the Ghost, before they went to Heaven.)
Hamlet notes that Claudius killed his father while his sins were still in full bloom. As King Hamlet had no time to repent, only Heaven knows how King Hamlet's account looked as he faced judgment.
Hamlet clearly reveres his dad, but he knows the old King didn't have a completely clean slate. That means that Hamlet's father has to suffer in the afterlife, and it's partly Claudius's fault.
Hamlet wants to make sure that Claudius must suffer the same punishment, therefore, he cannot kill Claudius when he has just confessed his sins to God.
So Hamlet decides he should kill Claudius another time. He hopes to get him while he's drunk, or angry, or in the midst of any other such truly deplorable activity. This way, there's no ambiguity about whether Claudius will go to Hell.
Hamlet notes his mother is waiting for him, and says Claudius's attempts at prayer are only going to prolong the days before Hamlet rains down vengeful death on his uncle.
After Hamlet exits (presumably to see his mother), Claudius notes that his prayers were useless, as he still thought about his evil deeds without repentance. Claudius is sure Heaven will see through his lying prayers, and realize he's not fully sorry.
In other words, Hamlet just missed his opportunity.