All about fire: http://www.fire.org.nz/facts_stats/science/science.htm#flame
Fire is made out of photons(light particles), when you burn something you give energy to its electrons, and they become excited jumping to a higher energy level(a higher orbit), but these electrons return to their original lower level state and emit a photon. The frequency of the emitted photon gives you the color of the fire, and this frequency depends much on the material burned, for example copper gives you green color, while potassium gives you purple, sodium gives you yellow, some fires could even be invisible if the photon are in the ultraviolet.