As I have mentioned before, I am only reading the LotR books for the first time right now, and I am only halfway through the second book at the moment, so my knowledge of the third book is based primarily on what I saw in the movies.
Until recently, when I watched the "Crack of Doom" scene (where Frodo enters the volcano in Mordor, ostensibly to destroy the Ring), this is how I always understood what was happening:
It has never occurred to Sauron that anyone would willingly destroy the Ring - this is simply inconceivable to him. Sauron is distracted by the battle. Frodo puts the Ring on, Sauron instantly becomes aware of him (and where he is), realizes that Frodo intends (or until recently intended) to destroy the Ring. Sauron's eye is immediately drawn to Mount Doom, and he is freaking out because he is perilously close to being annihilated. He recalls the Nazgul (at least those of them who haven't been killed by Eowyn or had their fell beasts killed by the Eagles) to Mordor, hoping against hope that they will be able to prevent the Ring from being destroyed by accident or by design. They won't arrive for some time (they are fast, but it will take them some time to cover the 50-100 miles from the Gate to the volcano). They don't get there soon enough, and Sauron has to watch helplessly as Frodo fights with Gollum, and eventually, Gollum ends up swimming in the lava.
But now that I'm reading the books, and reading some questions and answers on this site, I realize that I may have been mistaken. Now I wonder if I was right about what is happening in the movie, but the movie diverges from the books here, or if the movie is faithful to the book here and I have been misinterpreting the movie itself. [*See note 1 below]
Did Sauron fear that Frodo was planning to destroy the Ring or was he freaking out because he was worried that the Ring would accidentally end up in the lava?
Did he even realize that Frodo's original intention was to destroy the Ring? For that matter, does he even know that the lava is capable of destroying the Ring?
[Note 1: Specifically, until I read Richard's excellent answer, I was starting to think that even when Frodo dons the Ring inside volcano, Sauron isn't necessarily worried that he will destroy the Ring (either by accident or by design). Maybe Sauron isn't worried about anything - maybe he's actually happy because he finally knows where the Ring is and he thinks that all he has to do is send his Nazgul to retrieve it. Maybe it still hasn't occurred to him that Frodo had intended to destroy the Ring. Or maybe he realizes that Frodo HAD intended to destroy it, but he knows that Frodo, like everyone before him, has finally fallen under the Ring's spell, albeit at the last possible second. Maybe he doesn't feel any particular sense of urgency, and is simply eager to reclaim his beloved Ring. Or maybe he feels a sense of urgency only because he realizes that someone might accidentally drop the Ring into the lava, or fall into the lava with the Ring (this fear would be a well founded one, since this is precisely what happens).]