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.
Fine by them: 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," i.e. 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 the dynamic duo, Polonius shows up to say 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.
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). He can't even bring himself to pray.
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. Or the whole "out, out damned spot" business that Lady Macbeth goes through.)
Okay, but isn't this what prayer is for? To stop us from doing bad things, and to pardon us when we've done bad things?
But he can't ask for forgiveness for the murder, since 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).
At the same time, he's really suffering, man: 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.
Just then, Hamlet enters and raises his sword… and stops.
He realizes that, if Claudius dies while praying, the man will go to Heaven, since he'll have been forgiven for his sins.
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' 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 that his mother is waiting for him, and says Claudius' 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.