The Goblin Caves
The company falls into goblin caves and Bilbo has a contest of riddles.
Entering the caves
Crossing the Misty Mountains, the company takes shelter in a cave as a snowstorm pummels them. As they sleep, they are captured by goblins who live beneath the mountain. Bilbo is so small that the goblins lose track of him and he is separated from the company in the caves under the mountain.
A Game of Riddles
Bilbo is left alone to wander the caves and try to find his way out. He finds a golden ring just lying on the ground, which he puts in his pocket. He soon bumps into a creature named Gollum. Bilbo wants Gollum to show him the way out, while Gollum wants to eat Bilbo. They agree to play a game of riddles, with the winner getting what he wants.
Bilbo runs out of riddles that he knows and comes up with a simple question for Gollum: "What have I got in my pocket?" Gollum guesses three times and gets every one wrong, so he has to lead Bilbo to the way out. However, he has other plans, and goes off to get his magic ring, so he can turn invisible to eat Bilbo anyway.
Bilbo realizes that Gollum was lying to him and starts to run. In the process, he puts on the ring, and realizes that Gollum cannot see him. On the way out, he finds the company of dwarves and follows them until they get to the outdoors.
The Goblin King
The dwarves, meanwhile, were taken deep into the mountain, where they were presented to the Goblin King. The goblins find Orcrist and Glamdring, famed goblin-killing swords, and the Goblin King calls for the dwarves' heads. They run and they find the way out of the mountain.