A characteristic X-ray forms when a beam electron interacts with an orbital electron in the sample. If the energy of the beam electron is high enough, the orbital electron can be ejected from its shell leaving a vacancy behind (A). A vacancy cannot last long in an electron shell, and an electron from one of the outer shells will drop in to fill this hole.
However this outer shell electron will have the higher energy of the outer shell, and cannot reside in the inner shell this higher energy. Therefore it will give off the excess energy in the form of an X-ray photon. This X-ray will have a specific amount of energy. It will be equal to the difference in energy between the outer electron shell and the inner electron shell, which will be unique for that element. Therefore it is characteristic of the element that produced it.The X-ray will also have a particular wavelength. The wavelength of an X-ray photon is related to the energy through Planck's law which is shown on the right. So each characteristic X-ray has both a specific energy and a wavelength.
Below is an energy spectrum of the X-rays produced from copper. There are three characteristic X-rays, CuKa, CuKb, and CuLa. These multiple X-ray lines are produce because copper has a number of electron shells. Therefore each set of electron shells will produce X-rays of a different energy. Also below is a diagram outlining the nomenclature used for cataloging characteristic X-rays.