Why does heating an atom make it emit certain frequencies?
Absorbing photons is just one of ways atoms and their electrons, or molecules, can gain energy. Other ways are e.g mechanical collisions and chemical reactions.

Note that atoms do not reflect light they do not absorb, but let it pass through like if they were not there. If they had reflected it,  air would have been an opaque fog. A very small number of photons are dispersed by the Rayleigh scattering, what gives the sky it's blue colour.

A flame  contains mixture of 


atoms
atomic ions
free electrons
molecules
radicals(molecules with unpaired electrons}
molecular ions ( and ion radicals )


Atoms and atomic ions do have spectral lines in their emission or absorption spectra, related to particular energies, frequencies and wavelengths ( somewhat broaden, mostly  by the Doppler effect ).

But molecules, radicals and molecular ions have rather broad, diffuse bands.

Photons in UV, VIS and near IR have energies typical for electron excitations/transitions. 

Far IR and MW have energies needed to change molecular bond vibrations and bond/molecule rotations, as these are quantized as well.

High energetic collision and mainly chemics reactions frequently lead to a  molecule with excited electron. This energy gets dissipated either as mechanical energy passed to other molecules, or, it can be emitted.

Special cases are free electrons and solid matter in flames, that are not limited to particular frequencies at all.

Electrons can emit photons of any frequency (limited by electron energy ).

Solids ( smoke, large scale atomic structures ) have continuos emission spectrum.