Each character is great in his own way and each was equiped along the way to handle the burdens assigned to them by providence.
IMO, Frodo was the greatest character because his journey and task was greater. In the book all the characters recieve accolades for their heroism except Frodo which Tolkien explained was because the other Hobbits didn't really understand what he had done.
Sam gave up the Ring without even being asked. He volunteered it. It literally held no attraction for him. He never used it, was never tempted by its power, and never thought for an instant about keeping it for himself. Not even Galadriel, Elrond, or even Gandalf -- themselves all ring-bearers -- could boast such spiritual purity.