The emission and absorption can be lossy, but it does not have to be.
While in the overall picture energy is conserved other processes can either increase or decrease the photon energy. In practice this is used for cooling atoms with a laser beam. This doppler cooling uses photons to reduce the speed of gas atoms, the incoming photon energy is split between the kinetic energy of the atom to slow it down, the remaining energy is emitted as another photon with less energy.
As a side note: in the future we might be able to cool larger objects with this method, as the photons can be used to 'destroy' phonons and therefore cool a solid transparent material.