Bilbo could feel the dragon's fire at his back. It blazed out so swiftly that before he could think through his situation properly the hair on his heels and the clothes on his back were catching the flame, singeing and curling like the wick of a candle to bring the flame to his vulnerable skin. All the confidence that had been welling up in his heart over being able to skillfully keep up with a dragon in conversation drained away as he fled.
His feet pounded on the stone floor of the passage (still mercifully cool) as he ran faster than he would have normally thought possible. The heat was causing his eyes to tear up, making it difficult to see his way ahead. He blinked hard, and to his great relief he saw a light ahead. See that a straight run would take him out of the tunnel he closed his eyes and concentrated on breathing. The pursuing fire felt like it was stealing the air from his lungs, leaving him with no choice but to inhale flame through his newly parched mouth.
He was no longer able to form a coherent thought, but a vague idea of "almost there" kept him going. His mind was slipping away and he was sure that his vision would have been blurring if his eyes had been open. He willed his feet to go faster; his steps became clumsy instead. He felt himself reeling and falling forward. His last impression was a haze of memories (gold coins, red scales, campfire tales with the dwarves) and finally some wonderfully cool air on his face.
Balin and Bofur, standing anxiously at the mouth of the cave waiting for their now long overdue burglar, felt a wave of heat and saw a red glow that stopped their hearts in their chests. As they continued to watch the cave they saw a dark shape approaching, small and stumbling. They both stood up and steadfastly remained at their posts at the side of the tunnel entrance despite the heat. After a few tense moments the dark shape resolved into a fainting Bilbo, and the two dwarves soon found their arms full of hobbit.
Balin, noticing the Bilbo's smoldering back and the scattered flames among his curls, called out, "Your coat Dwalin! Quick!"
Dwalin was at his brother's side in two strides and he immediately threw his heavy fur coat onto the back of the still senseless hobbit. He quickly got his strong arms under Bilbo's light body, taking the bulk of the hobbit's weight from Balin and Bofur and rolling the coat completely around the Bilbo, helped by Bofur. Together they lowered Bilbo gently to the ground, with Balin now supporting his head, and once they had him lying on his side Dwalin patted his rough hands firmly on the coat, hoping to smother any remaining blaze.
The rest of the dwarves, who had been watching from a short distance, now sprang into action. Thorin began barking out orders, as he always did when he was worried.
"Oin, go attend to our burglar! Ori, carry Oin's pack for him. Fili, Kili—fetch as much water as you can."
Cries of "Yes, Thorin" And "Yes, Uncle" (the latter said in unison) sounded behind the dwarf king as he stumped over to Bilbo, easily reaching him before the less active Oin.
Dwalin was unwrapping Bilbo from his coat, apparently satisfied that he was no longer burning. Part of the coat still remained under the hobbit as a cushion against the hard stone. Thorin inhaled sharply as he saw the large black burn marks on Bilbo's coat and trouser legs and the frazzled hair on his woolly head and feet. Balin frowned from where he sat still supporting Bilbo's head and peering intently into his face. Balin looked up as Oin lumbered over, Ori close behind nervously holding Oin's bulky supplies.
"His breathing is shallow and ragged," Balin said, his voice sharp with concern, "And he seems unaware of our presence."
"Let me see him." Oin said, kneeling down next to Balin, who slid over to make room for him. Thorin watched as Oin loosened Bilbo's shirt collar, leaned over and put his ear trumpet near Bilbo's mouth and, after listening for a minute, took his fingers and pressed them to Bilbo's neck to feel his pulse.
Oin patted Bilbo on the cheek and said, loudly but in a bright and reassuring tone, "Wake up, laddie! You're safe now, we've got you. You can open your eyes."
To the dwarves' relief Bilbo responded to Oin by wheezing loudly, coughing and moving his eyelids slightly. He seemed to be trying to speak, but all that came out was more coughing and some hoarse groaning.
"Just be still, lad. No need to talk. We're taking care of you." Balin said soothingly, trying to distract the Hobbit while Oin continued to examine him, satisfied that the subject of his ministrations could breathe adequately for now.
Oin began to gently peel off Bilbo's coat, leading to soft cries of pain from the hobbit as the material rubbed against his burned skin. Oin and Balin muttered reassurances as they continued to strip off the coat. Thankfully, the coat having taken the main force of the dragon's fire; underneath it his shirt and trouser seat bore only a faint discoloration.
Oin inspected Bilbo's skin, lifting up the back of his shirt, pulling down his collar, and rolling up the legs of his trousers. His examination revealed minor burns, no more than reddened skin, on part of Bilbo's back, legs and hands; deeper, more painful burns could be seen on his neck and the back of his head, and also on his exposed feet, particularly at his heels. Turning him over to look at him from the front Oin could see no signs of further damage; all the burns were on his back. Bilbo had now recovered enough to open his reddened eyes and focus on Oin, who squeezed his shoulder comfortingly.
"Well, now, that could have been much worse. Nothing too serious and nothing that can't heal. The worst burns are on the back of your head and on your heels: there are some blisters and it will be some time before your hair grows back properly. I have some of my own treatment, some "ointment" if you will, that should help you heal and ease your burns. I can also give you some tea for the pain. I'll wager you would like some water first, though."
Bilbo nodded slowly, still feeling disoriented, and uttered a"Please" so soft that it was doubtful anyone heard him. He sat up slowly and painfully, with Bofur steadying him.
Fili quickly offered Bilbo one water skin while his brother began to wet down a clean handkerchief with another. Noticing that Bilbo's hands were burned and shaking, Fili mumbled "Here, let me help you with that" and tipped back the water skin gently to allow Bilbo to take small sips.
Bilbo got the water down, painfully at first, but after several swallows his mouth began to feel somewhat normal again and the cool relief finally reached his throat. He drank for a while, than managed to say "That's enough, thank you." loud enough that the dwarves actually heard him this time.
Kili held out a wet handkerchief. "Put this over your eyes. I'll bet they're still stinging." Kili's own dark eyes showed kindness and concern.
Bilbo took the cloth gratefully, though he did pause for a moment to survey his companions. It touched his heart to see the concern in their faces as they watched him, though it did make him rather embarrassed as well, knowing that his wounds were at least in part due to his own reckless taunting of the dragon. He hid his eyes with the handkerchief, finding it did indeed bring relief to the stinging. Bofur and Balin were supporting him on either side now, also helping to keep him warm in the air that seemed so chill after being near the dragon. Bilbo was wrapped in Dwalin's fur and soon felt another furry garment thrown over his shoulders, probably from Fili. He heard the deep rumble of Thorin talking to Oin; he thought he might be detecting a rare note of concern in the king's voice. He heard Oin answer Thorin in an upbeat tone, talking about "rest", "water", and "keep him warm and quiet." Bilbo felt a rush of gratitude towards the dwarves; They were gruff but faithful, loyal, and kind when needed. He just hoped he could serve their quest better at the next trial than he had in his conversation with the dragon.
Based on this passage:
“The afternoon was turning into evening when he came out again and stumbled and fell in a faint on the 'doorstep.' The dwarves revived him, and doctored his scorches as well as they could; but it was a long time before the hair on the back of his head and his heels grew properly again: it had all been singed and frizzled right down to the skin.”
J. R. R. Tolkein, The Hobbit, Chapter 12: "Inside Information"