The bodies in the Dead Marshes are fell corpses from the Battle of Dagorlad (The Last Alliance of Men and Elves against Sauron, depicted in the prolouge of the first film). They are ghostly / unreachable corpses that seem to have an ethereal light or "candle" around them. Gollum relates this information to the hobbits, and tells them to not touch or enter the water, lest they die (ie - 'light candles of their own') as well (either from basic drowning or supernatural curse is unstated I believe).
In the film, Gollum tells them to not follow the lights - namely, don't get distracted by the light (like a mirage) and tumble into the water. Frodo however, does exactly that, and Gollum saves him. What Frodo "sees" when saying / looking at Gollum after being saved is a last vestige of humanity in Gollum, that he, Gollum, would save Frodo. Frodo surely expected that it was Sam that had rescued him, not Gollum. In the film, Gollum reiterates "don't follow the lights" - as an "I told you not to do that, see, something bad can happen to you, I know what I'm talking about, you can trust me."
In the book, Gollum knows not to follow the lights because he tried to reach out and touch them on his original journey through the Marshes and was unable to.
Quotes from the scene in the book:
'The Dead Marshes, yes, yes: that is their names,' he cackled. `You
should not look in when the candles are lit.'
`Who are they? What are they? ' asked Sam shuddering, turning to
Frodo, who was now behind him.
'I don't know,' said Frodo in a dreamlike voice. 'But I have seen them
too. In the pools when the candles were lit. They lie in all the
pools, pale faces, deep deep under the dark water. I saw them: grim
faces and evil, and noble faces and sad. Many faces proud and fair,
and weeds in their silver hair. But all foul, all rotting, all dead. A
fell light is in them.'
Frodo hid his eyes in his hands. 'I know not who they are; but I
thought I saw there Men and Elves, and Orcs beside them.' 'Yes, yes,'
said Gollum. `All dead, all rotten. Elves and Men and Orcs. The Dead
Marshes. There was a great battle long ago, yes, so they told him when
Smeagol was young, when I was young before the Precious came. It was a
great battle. Tall Men with long swords, and terrible Elves, and
Orcses shrieking. They fought on the plain for days and months at the
Black Gates. But the Marshes have grown since then, swallowed up the
graves; always creeping, creeping.'
'But that is an age and more ago,' said Sam. 'The Dead can't be really
there! Is it some devilry hatched in the Dark Land? '
'Who knows? Smeagol doesn't know,' answered Gollum. 'You cannot reach
them, you cannot touch them. We tried once, .yes, precious. I tried
once; but you cannot reach them. Only shapes to see, perhaps, not to
touch. No precious! All dead.' Sam looked darkly at him and shuddered
again, thinking that he guessed why Smeagol had tried to touch them.
`Well, I don't want to see them,' he said.
'Yes, yes,' said Gollum. `But slowly, very slowly. Very carefully! Or
hobbits go down to join the Dead ones and light little candles.