The only way I could see Sam dealing with the Ring (he absolutely could never hurt Frodo or take the Ring from him) is to sacrifice both himself and Mr. Frodo for the good of Middle-earth, i.e., grabbing Frodo and tumbling together into the Fire. But I really don't see this as a solution either for two reasons: (1) because I believe the Professor would have found the notion of suicide abominable, even for such a worthy end; and (2) I also think it flies in the face of Sam's virtually cellular-level and completely unquenchable hope and optimism.
Frodo believed very early on that he would not survive the Quest, and I think towards the end he probably believed that the only way he would be able to destroy the Ring would be to throw it and himself in the Fire. He never SAYS so, but every statement he makes about the Quest implies that his sole hope is to get to the Mountain and see the deed done; he never expected to survive it.
It is Sam who constantly worries about their provisions and about having enough left to "get home." It isn't until after their disastrous encounter with the troop of orcs that force-marches them across the plains of Gorgoroth to the entrance to Udun that Sam finally realizes their provisions might at best get them TO the mountain, and that's all:
. . . and when the task was done, there they would come to an end, alone, houseless, foodless in the midst of a terrible desert. There could be no return. 'So that was the job I felt I had to do when I started,' thought Sam: 'to help Mr. Frodo to the last step and then die with him? Well, if that is the job then I must do it . . . .' But even as hope died in Sam, or seemed to die, it was turned to a new strength. Sam's plain hobbit-face grew stern, almost grim, as the will hardened in him, and he felt through all his limbs a thrill, as if he was turning into some creature of stone and steel that neither despair nor weariness nor endless barren miles could subdue.
" . . . or seemed to die
," is a very telling statement by the Professor. Even when Sam "seems" to have given up hope, he really hasn't. After Gollum and the Ring go into the Fire, Frodo is ready to just lie down and die, but Sam has other plans. " . . . after coming all that way I don't want to give up yet
. It's not like me, somehow
, if you understand . . . . Well, Master, we could at least go further from this dangerous place here, from this Crack of Doom, if that's its name. Now couldn't we? Come, Mr. Frodo, let's go down the path at any rate!"
Even when they can't go any farther and are cut off from any hope of escape by the lava, Sam determinedly keeps his fear at bay, wishing he could hear the story of "Nine-fingered Frodo and the Ring of Doom" and keeping his eyes firmly to the north "where the sky far off was clear, as the cold blast, rising to a gale, drove back the darkness and the ruin of the clouds."
Nope, if the Professor ever did consider putting Sam in the position of getting rid of the Ring, I think he very quickly figured out that the only possible scenario for doing so would ultimately be completely against Sam's basic nature.