  XAFS studies of Ni-doped Ba$_{1-x}$Sr$_x$TiO$_3$ solid solution reveal that
the Ni oxidation state changes from 4 in SrTiO$_3$ to 2.5 in BaTiO$_3$ when
varying $x$. This change is accompanied by a noticeable change in the
interatomic Ni-O distances in the first shell. The first-principles
calculations show that nickel creates an impurity band in the forbidden band
gap of BaTiO$_3$ and SrTiO$_3$, which explains the appearance of intense
absorption of Ni-doped samples in the visible region. The analysis of the
electronic structure of doped crystals and calculations of the oxygen vacancy
formation energy in them show that different oxidation states of Ni in
SrTiO$_3$ and BaTiO$_3$ can be explained by different formation energies of the
oxygen vacancies in these compounds.
