In Lord of the Ring, Gandalf throws the ring into the fire. When Frodo fishes it out there is writing underneath the band. Gandalf tells him this prophecy:
Three Rings for the Elven-kings under the sky,
Seven for the Dwarf-lords in their halls of stone,
Nine for Mortal Men doomed to die,
One for the Dark Lord on his dark throne
In the Land of Mordor where the Shadows lie.
One Ring to rule them all, One Ring to find them,
One Ring to bring them all and in the darkness bind them
In the Land of Mordor where the Shadows lie. (p. 49)
He tells Frodo that the ring he has is the One Ring to rule them all and that Sauron had it at one time. There was a great battle and a king named Isilur cut off Sauron's hand. But, instead of throwing the ring into the pits of Mordor, he kept it for himself. He wasn't able to keep it for long as he was attacked by Orcs and the ring fell into the river. Then Smegol found it, killed his friend to keep it. And, of course, he lost it again in the waters, until Bilbo found it many years later.