Ab initio calculations of the electronic structures of binary ZnO- and TiO2-based oxides are performed to search for optimum dopants for efficient absorption of the visible part of solar radiation. Light elements B, C, and N are chosen for anion substitution. Cation substitution is simulated by 3d elements (Cr, Mn, Fe, Co) and heavy metals (Sn, Sb, Pb, Bi). The electronic structures are calculated by the full-potential linearized augmented plane wave method using the modified Becke-Johnson exchange-correlation potential. Doping is simulated by calculating supercells Zn15D1O 16, Zn16O15D1, Ti15D 1O32, and Ti8O15D1, where one-sixteenth of the metal (Ti, Zn) or oxygen atoms is replaced by dopant atoms. Carbon and antimony are found to be most effective dopants for ZnO: they form an energy gap ΔE = 1.78 and 1.67 eV, respectively. For TiO 2, nitrogen is the most effective dopant (ΔE = 1.76 eV).