The energy gap Eg between the valence and conduction bands is a key characteristic of semiconductors. Semiconductors, such as TiO2, SnO2, and CeO2 have a relatively wide band gap Eg that only allows the material to absorb UV light. Using the s-d microscopic model and the Green’s function method, we have shown two possibilities to reduce the band-gap energy Eg—reducing the NP size and/or ion doping with transition metals (Co, Fe, Mn, and Cu) or rare earth (Sm, Tb, and Er) ions. Different strains appear that lead to changes in the exchange-interaction constants, and thus to a decrease in Eg. Moreover, the importance of the s-d interaction, which causes room-temperature ferromagnetism and band-gap energy tuning in dilute magnetic semiconductors, is shown. We tried to clarify some discrepancies in the experimental data.