The Kramers-Heisenberg formula clearly allows for the initial and final state to be different.
The atom changes state and the scattered photon energy is not equal to the initial photon energy.
This is called the Raman effect.
Of course, total energy is still conserved.
A given initial photon frequency will produce scattered photons with definite frequencies, or lines in the spectrum.