This work presents the results of the X-ray photoelectron spectroscopy investigation of carbon films obtained by ion-plasma deposition at various plasma compositions. The detailed analysis of X-ray photoelectron spectra makes it possible to determine the structure of the deposited films and the influence of the presence of nitrogen and hydrogen in the plasma on the structure. Diamond-like films are obtained in pure argon plasma. The addition of nitrogen leads to a dramatic increase in the graphite-like phase while the addition of hydrogen corresponds to the formation of carbon chains.