In The Hobbit, Thorin's company is captured by giant spiders of Mirkwood—descendants of Ungoliant. Shelob (from The Lord of the Rings) dwells in Cirith Ungol, Mordor, not Mirkwood.
The spiders ensnare the dwarves in webs; Bilbo rescues them using the Ring and his sword Sting.