Gandalf: [about Gollum] Smeagol’s life is a sad story. Yes, Smeagol he was once called… before the Ring came to him. Before it drove him mad.
Frodo: It’s a pity Bilbo didn’t kill him when he had the chance.
Gandalf: Pity? It was pity that stayed Bilbo’s hand. Many that live deserve death, and some that die deserve life. Can you give it to them, Frodo? Do not be too eager to deal out death in judgment. Even the very wise cannot see all ends. My heart tells me that Gollum has some part to play, for good or ill, before this is over. The pity of Bilbo may rule the fate of many.
Frodo: I wish the Ring had never come to me. I wish none of this had happened.
Gandalf: So do all who live to see such times; but that is not for them to decide. All we have to decide is what to do with the time that is given to us. There are other forces at work in this world, Frodo, besides the will of evil. Bilbo was meant to find the Ring. In which case, you were also meant to have it. And that is an encouraging thought.