When a wave travels from one medium to another it undergoes a change in direction and this is referred to as refraction.
Refraction is the bending of a wave or a change in direction of a wave as it travels from one medium to another. Refraction is accompanied by change in velocity and wavelength of a wave.
Velocity of a wave is proportional to the wavelength of the wave therefore, if the velocity of a wave changes the the wavelength will also change proportionally to the velocity.
Before burning the marshmallow energy is stored in it in the form of chemical bond energy or chemical potential energy. So upon burning this energy is released. So there will be a difference in energy release from a burned marshmallow and the one we eat straight from package.