So, when a hand reaches in to pull Frodo out, it's easy to think it would be Sam's. However, it was Gollum. Frodo was visibly shocked at what he'd seen, and perhaps at Gollum saving him.