I was reading on the electromagnetic spectrum when I thought if an atom/electron is absorbing the energy from the light ray falling on it, how and by when will it get rid of the excess energy to become stable again. If it emitted the light radiation at the same instant, wouldn't it interfere with the emission spectrum band?
An electron is an elementary particle of fixed mass. It can scatter off a photon, (which is also an elementary particle); if accelerated it can emit a photon, but it does not absorb it, because the electron's mass is fixed, and if it were able to absorb a photon - at the electron's center of mass - the mass would have to change, which contradicts observations and special relativity for elementary particles.
The terms absorption and absorbs are not usable with free electrons. It is the bound electrons in an atomic system, which may change energy levels in the atom when the atom absorbs a photon. So it is not the electron that absorbs the photon, but the atom.
The atom has energy levels, and if the photon energy coincides (within a small ΔE, the width of the energy level) with the transition energy of kicking an electron to an empty energy level, then the atom can absorb the photon (not the electron). So the answer to "why", above, is "because the photon has the appropriate energy to transfer the electron to an empty energy level".
If the photon energy does not coincide with transition energy of the atom, the photon may scatter with the spillover electric fields of the atom or molecule either elastically, or transferring energy and a lower energy photon continues on its way.
The relevant thought to keep is that an elementary particle cannot absorb a photon. Composite ones as atoms, molecules and lattices, can.