The correct one is gamma rays. Lets go over them one by one.
Gamma rays are rays that arise from gamma decay, a type of radioactive decay. Often, after another decay, the nucleus is still unstable and it gives off energy in the form of gamma rays to stabilize itself. Hence, gamma rays have nothing to do with the electron structure, only with the nucleus of the atom.
X-rays are the product of accelerating electrons, hence only specific atoms can emit a specific energy of X-rays; similarly for the photoelectric phenomenon, the energy which is needed for photoelectrons to be created depends on the electron structure of the atom (in both cases, it is important to see how strong the bond between electron and atom is). Finally, spectral lines differ depending on the electron structure of the atoms since electrons with different energies absorb different frequencies of light.