Understanding how charge and energy, as well as protons and hydrogen atoms, are transferred in molecular systems as a result of an electronic excitation is fundamental for understanding the interaction between ionizing radiation and biological matter on the molecular level. To localize the excitation at the atomic scale, it was chosen to target phosphorus atoms in the backbone of gas-phase oligonucleotide anions and cations, by means of resonant photoabsorption at the L-and K-edges. The ionic photoproducts of the excitation process were studied by a combination of mass spectrometry and X-ray spectroscopy. The combination of absorption site selectivity and photoproduct sensitivity allowed the identification of X-ray spectral signatures of specific processes. Moreover, charge and/or energy as well as H transfer from the backbone to nucleobases has been directly observed. Although the probability of one versus two H transfer following valence ionization depends on the nucleobase, ionization of sugar or phosphate groups at the carbon K-edge or the phosphorus L-edge mainly leads to single H transfer to protonated adenine. Moreover, our results indicate a surprising proton-transfer process to specifically form protonated guanine after excitation or ionization of P 2p electrons.