Cone beam computed tomography (CBCT) is used to determine a patient position in proton therapy, but its image quality is low compared to that of a conventional CT because data measured by a two-dimensional detector used in CBCT contain scattered X-ray components. Correcting for scattered X-rays using the Klein-Nishina’s formula can improve CBCT image quality, but the formula requires the atomic number and number density of substances. In this work, we developed a photon-counting image reconstruction method for estimating the atomic number and number density using the energy information of X-rays. When the developed method was applied to an X-ray energy spectrum of a gantry-mounted CBCT which was simulated with a Monte Carlo simulation code, it was possible to distinguish soft tissues from water in the simulated object, which was not possible without the energy information. An atomic number and number density obtained with our method allows to calculate the stopping power of protons more accurately, which can contribute to improving dose calculation accuracy.