When the beam electrons (and scattered electrons from the sample) interact with bound electrons in the innermost electron shells of the atoms of the various elements in the sample, they can scatter the bound electrons from the electron shell producing a vacancy in that shell (ionization of the atom). This vacancy is unstable and must be filled by an electron from either a higher energy bound shell in the atom (producing another vacancy which is in turn filled by electrons from yet higher energy bound shells) or by unbound electrons of low energy. The difference in binding energy between the electron shell in which the vacancy was produced and the shell from which the electron comes to fill the vacancy is emitted as a photon. The energy of the photon is in the X-ray region of the electromagnetic spectrum. As the electron structure of each element is unique, the series X-ray line energies produced by vacancies in the innermost shells is characteristic of that element, although lines from different elements may overlap. As the innermost shells are involved, the X-ray line energies are generally not affected by chemical effects produced by bonding between elements in compounds except in low atomic number (Z) elements ( B, C, N, O and F for Kalpha and Al to Cl for Kbeta) where line energies may be shifted as a result of the involvement of the electron shell from which vacancies are filled in chemical bonding.