On a rainy evening in Bree, Thorin Oakenshield discreetly arrives at the Prancing Pony, where he encounters Gandalf the Grey, who warns Thorin Oakenshield that someone is trying to have him killed. He persuades Thorin to march upon the Lonely Mountain and obtain the Arkenstone to unite the dwarves of Erebor, and suggests that a stealthy burglar may be needed to steal the jewel back from Smaug.
Twelve months later, Thorin and his company are being pursued by Azog and his orc party down the Carrock following the events of the previous film. Bilbo, who is on a ridge scouting out the surrounding area, witnesses a massive bear stalking them nearby, and returns to inform the group tof the bear's presence. Gandalf expresses familiarity with the beast, and reveals he knows of a dwelling nearby where they can seek shelter.
The bear suddenly picks up their scent and gives chase, forcing the company to make a desperate run for the house. Upon their arrival, they are attacked by the bear but manage to repel it by barring the door to the house. Gandalf reveals that it is the home Beorn, a skin-changer who is in fact the bear they have been fleeing from.
As a bear, Beorn is violent and unpredictable in nature, but as a man he is more prone to reason, and that he may be able to aid them in their journey. That night, Azog and his warband watch Beorn's house from a distance, though Azog is unwilling to attack the settlement as Beorn is guarding the house in his bear form.
Suddenly, Bolg appears and informs Azog that he has been summoned to Dol Guldur by the Necromancer. Azog arrives at Dol Goldur, where the Necromancer instructs him to abandon his pursuit of the dwarven company to lead the Necromancer's armies. Azog reluctantly obeys, instructing Bolg to take over the hunt for the dwarves in his stead.
The next day, Beorn, having transformed back into his human form, discusses the dwarves's quest with the company, expressing doubt that they will reach the forest of Mirkwood alive due to the increasing numbers of orcs roaming the lands of late. He expresses his disdain for dwarves, but admits that he harbors a far greater hatred of orcs, having had his kind all but wiped out by Azog and the orcs of Gundabad for sport.
He agrees to loan his horses to the company so that they can safely reach Mirkwood, and transforms back into a bear in order to hinder the pursuing orcs led by Bolg. Upon arriving at the forest's edge, Gandalf discovers Black Speech graffiti imprinted on an old ruin, coinciding with a telepathic message from Galadriel imploring him to investigate the High Fells of Rhudaur.
Without giving any reason for his sudden departure, Gandalf advises the company to follow the Elven path though Mirkwood, and to wait for him before entering the Lonely Mountain. The dwarves make their way into the labyrinthian forest, traveling for days without seeing sunlight or any sign of reaching the other side of the forest, and paranoia begins to set in amongst the group.
The dwarves eventually reach a chasm where the path runs off, and begin to succumb to hysteria upon realizing they have lost their way. Bilbo climbs a tree to try and get their bearings, and upon reaching the forest canopy he finds they have nearly reached the other side forest and sees Long Lake in the distance. He excitedly calls down his discovery to his companions, but myseriously receives no reply.
Suddenly, Bilbo notices the trees moving off in the distance, and begins climbing down when he realizes whatever it is, it's moving towards them. In the process of climbing down, he loses his footing on a web and falls into an even larger web, revealed to have been spun by a giant spider, who promptly attacks and cocoons him.
Bilbo awakens some time later to find that he and the rest of his companions have all been captured, cocooned, and taken to a massive spider nest by a large number of Great Spiders. One of them prepares to carry Bilbo's cocooned body over to where the others are, which prompts Bilbo to spring into action, driving his sword through the webbing and impaling the spider's underbelly and sending it tumbling to the forest floor below.