The electronic structures of five polycrystalline YNi2−xCoxB2C (x=0, 0.05, 0.1, 0.15, and 0.2) borocarbide superconductors were studied by photoemission and photoabsorption spectroscopies and theoretical calculations. The valence-band (VB) photoemission spectrum is compared with the theoretical total and partial density-of-states (DOS) curves. The VB satellite is peaked at a binding energy (EB) of 6 eV. The Ni K-edge x-ray absorption near edge spectra (XANES) are compared with the calculated XANES spectra for these intermetallic compounds. Extended x-ray absorption fine structure (EXAFS) spectra at the Ni and Co K edges are analyzed to yield the structural parameters. The decrease of the superconducting transition temperatures (Tc) with addition of Co dopant in these compounds is due to a decrease of the total DOS at the Fermi level (EF).