By praying to God, Claudius is setting the truth free. He knows what he did was wrong, but still committed with his actions. Hamlet is beyond furious when he hears what he has known all along. Claudius is also being set free because we, the readers, foreshadow that Hamlet is going to kill him. Hamlet just has to wait for the right moment when Claudius is not in touch with God.