Flames are complicated objects that form when a fuel reacts with oxygen and releases heat and light. Clean fuels like propane or alcohol or natural gas burn mainly into carbon dioxide and water vapor, both of which are invisible. Blue flames, such as the ones from a propane torch or gas stove, are of this kind, and while quite a bit of heat is produced, you don't see much light. The exact colors depend on all sorts of details, but the important thing is that there isn't much light emitted.
Yellow flames such as those from a campfire or candle, come from the burning of relatively "dirty" fuels, in the sense that the fuel is not completely converted into carbon dioxide and water, but leaves little bits of unburned carbon. Those bits of carbon get hot and glow, making the yellow light that you see. Once they cool a bit, those bits of carbon - and other unburnt stuff that isn't carbon dioxide or water vapor - also go into making smoke, which is why the clean, blue flames are smokeless, while the dirty, yellow flames come with smoke.
You can easily do a little experiment at home to see this for yourself. Hold a spoon in a clean flame - a little bit of burning alcohol, say, or the gas flame of a stove - and you'll see that it comes back out fairly clean. If you hold the same spoon in the light of a candle or a match you'll find it comes out covered in soot. That soot is the carbon that gets hot and glows in a dirty flame.
Dr. Knowledge is written by physicists Stephen Reucroft and John Swain, both of Northeastern University. E-mail questions to email@example.com or write Dr. Knowledge, c/o The Boston Globe, PO Box 55819, Boston, MA 02205-5819.