When something burns, it is being oxidised. This causes an exothermic reaction, the by-product being heat (energy) This energy excites atoms and electrons. The electrons jump into a higher energy state, and at sometime later "cool" by releasing this higher state energy. This energy is given off as electomagnetic radiation, (infra-red [heat]) and normal light which you can see (yellow/red flame...) :-))