He had the ring in Númenor, and Tolkien feels that people shouldn't "boggle" at how his spirit carried it off.
In October of 1958, Tolkien wrote a long letter to Dr. Rhona Beare (then a student at Exeter University, responding to a list of twelve questions she sent him on behalf of a group of "fellow-enthusiasts for The Lord of the Rings".
‘Question 2’: How could Ar-Pharazôn defeat Sauron when Sauron had the One Ring?
This question, & its implications, are answered in the ‘Downfall of Númenor’, which is not yet published, but which I cannot set out now. ...
Ar-Pharazôn, as is told in the ‘Downfall’ or Akallabêth, conquered a terrified Sauron’s subjects, not Sauron. Sauron’s personal ‘surrender’ was voluntary and cunning1: he got free transport to Númenor! He naturally had the One Ring, and so very soon dominated the minds and wills of most of the Númenóreans. (I do not think Ar-Pharazôn knew anything about the One Ring. The Elves kept the matter of the Rings very secret, as long as they could. In any case Ar-Pharazôn was not in communication with them. In the Tale of Years III p. 364 you will find hints of the trouble: ‘the Shadow falls on Númenor’. After Tar-Atanamir (an Elvish name) the next name is Ar-Adûnakhôr a Númenórean name. See p.315. The change of names went with a complete rejection of the Elf-friendship, and of the ‘theological’ teaching the Númenóreans had received from them.)
Sauron was first defeated by a ‘miracle’: a direct action of God the Creator, changing the fashion of the world, when appealed to by Manwë: see III p. 317. Though reduced to ‘a spirit of hatred borne on a dark wind’, I do not think one need boggle at this spirit carrying off the One Ring, upon which his power of dominating minds now largely depended. That Sauron was not himself destroyed in the anger of the One is not my fault: the problem of evil, and its apparent toleration, is a permanent one for all who concern themselves with our world. The indestructibility of spirits with free wills, even by the Creator of them, is also an inevitable feature, if one either believes in their existence, or feigns it in a story.
1 Note the expression III p. 364 ‘taken as prisoner’.
Letter to Rhona Beare, 14 October 1958, Letter of JRR Tolkien #211
Tolkien does not seem to have ever explained how a spirit could carry a ring, but he explicitly says that it's what happened, so I guess we'll just have to take his word for it that it's possible in his universe.