Q : What happens when Photons hits the electron ?
If electron is loosely bound (quasi-free), then it will lead to Compton scattering (Compton scattering is the inelastic scattering of a photon by a charged particle, usually an electron. It results in a decrease in energy (increase in wavelength) of the photon ) . Photon hits the electron and give some of its energy and go in some different direction with larger wavelength. Electron will gain kinetic energy and move in some other direction.
If the electron is bound in outer shell then photo-electric effect will take place. If the energy of photon is large enough to remove the electron from atom, it will do so. If it’s not large then photon will pass unaffected.
If the photon energy is large enough to knock a tightly bound electron in inner shell , then it might lead to X-ray production . Photon knocks out an electron from inner Shell . Since inner shell being filled is energetically more favourable , an electron from outer shell jumps into inner shell , emitting extra energy in form of radiation (which usually lies in X-ray spectrum ).