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.
Bilbo quickly frees himself and hides behind a tree, slipping on the Ring, which he discovers allows him to hear and understand the giant spiders, who are excitedly planning to devour the entire group. Bilbo grabs a rock and throws it to the forest floor, distracting the spiders and allowing him to free the dwarves while the spiders investigate source of the noise.
However, one spider lingers behind hoping to sample one of the dwarves before the others return. Bilbo sneaks up on it while still invisible and attacks it, slashing it several times and eventually stabbing it with his sword. causing it to cry out that the sword "stings" before falling to his death. Bilbo, struck by the spider's dying remark, decides to call his sword Sting, and sets about freeing the others.
However, the spiders quickly return and a battle breaks out, during which Bilbo drops the Ring. He eventually relocates it and kills a crab-like spider who has taken possession of it. Upon being reunited with the Ring, Bilbo begins to realize that it may be beginning to exert a corrupting influence over him as he realizes he is growing increasingly unwilling to part with it.
Meanwhile, the dwarves continue to battle the giant spiders, and are in danger of being overwhelmed until the sudden appearance of two wood elves, Legolas and Tauriel, who dispatch the remaining spiders. Suddenly, an entire squad of elven rangers appears, easily outnumbering the dwarven company, and Legolas orders them to search the dwarves.
Upon discovering that Thorin is in possession of an elvish blade, Legolas orders them to be taken as prisoners, refusing to believe that he came into possession of the sword voluntarily. The elvish rangers bring the dwarves to the wood elven kingdom of Mirkwood, unaware that Bilbo is following them under the protective cloak of the Ring, managing to just barely slip inside of the front gates undetected.
While the others are placed in cells, Thorin is brought before Legolas' father, King Thranduil, who reveals that he knows why Thorin seeks to return to the Lonely Mountain, offering to help Thorn if he shares some of Erebor's wealth with him. Thorin appears to consider the offer for a moment before angrily refusing, reminding Thranduil that the elves did not come to the dwarves' aid during the sacking of Erebor.
Incensed, Thranduil has Thorin thrown into the dungeons with the others until he feels more agreeable to his offer. Meanwhile, Tauriel approaches Kili's cell, where he is examining a talisman, and they engage in conversation, and although they hail from different worlds, they both clearly share a mutual curiousity of one another.