In Chapter Twelve, entitled "Inside Information," of The Hobbit, Bilbo shows great cleverness when he plays to Smaug's pride by flattering the dragon to trick him into revealing his weakness.
The first time when Bilbo makes a trip inside Smaug's lair, he only steals a cup. Although the dwarves are pretty excited to see Bilbo's stolen cup, Thorin has a larger issue to deal with--he needs a way to get rid of Smaug, so the dwarves can have the Lonely Mountain to themselves again. Thorin has told Bilbo "every worm has his weak spot," and he very much wishes that Bilbo could help the dwarves by identifying Smaug's.
When Bilbo returns to Smaug's lair the second time, Smaug confronts the humble burglar about the recent theft; this is when Bilbo's quick wit and clever thinking comes into play. He praises Smaug as the "Chiefest and Greatest of Calamities" and "Lord Smaug the Impenetrable" (200, 203). Smaug has a fondness for boasting of his own greatness and shows Bilbo his chest "armored above and below with iron scales and hard gems" (203). For all the dragon's boasting, Bilbo notices a large bare patch, a weakness in Smaug's scaly armor. This moment in the chapter is another great example of how Bilbo uses his cunning wits to his best advantage in difficult situations.