How does Gandalf get Beorn to welcome the dwarves and Bilbo into his home?
Beorn the "bear man" in J. R. R. Tolkien's The Hobbit does not like a lot of company, and he would certainly not willingly accept 13 dwarves, a hobbit and a wizard into his home in one big group. In order to introduce the party bit by bit so that Beorn will allow them to stay, Gandalf and Bilbo first begin to talk with him about the adventures they have been having with the dwarves. Beorn becomes so engrossed in the tale that he barely notices when the dwarves begin to arrive two at a time.
Beorn learns about the war from the captured Warg and Goblin, and he rushes to help the dwarves.
While walking through Mirkwood, the dwarves run out of food. Seeing the twinkling lights and hearing laughter, the dwarves leave the path in the hope of finding friendly folks who will feed them.
Thorin managed to escape the spiders only to be captured by the Wood Elves and put in the Elvenking's dungeon. Even though Bilbo manages to rescue the remaining dwarves who were ensnared in the spiders' webbing, they, too, get captured by the Wood Elves, and Bilbo is forced to find a way to rescue the whole party.
Gandalf basically keeps Beorn talking in order to put Beorn at ease. Through their conversation, he slowly introduces the dwarves, so as not to overwhelm Beorn... before Beorn knows it, he has accepted a whole gang, not just a few travelers.
In Mirkwood, the dwarves are suffering from awful hunger pains. They are distracted by the sounds of forest elves and flickering lights that seem to be fire lights. They leave the path hoping to find food.
Thorin was captured by the wood elves when the others were captured by the spiders. The group in reunited when the rest of them are taken in by the wood elves.