Various atomic and nuclear methods use hard (high-energy) X-rays to detect elements. The current study aims to investigate the hard X-ray production rate via high-energy proton beam irradiation of various materials. For which, appropriate conditions for producing X-rays were established. The MCNPX code, based on the Monte Carlo method, was used for simulation. Protons with energies up to 1650 MeV were irradiated on various materials such as carbon, lithium, lead, nickel, salt, and soil, where the resulting X-ray spectra were extracted. The production of X-rays in lead was observed to increase 16 times, with the gain reaching 0.18 as the proton energy increases from 100 MeV to 1650 MeV. Comparatively, salt is a good candidate among the lightweight elements to produce X-rays at a low proton energy of 30 MeV with a production gain of 0.03. Therefore, it is suggested to irradiate the NaCl target with 30 MeV proton to produce X-rays in the 0–2 MeV range.