Conversion of optical energy to chemical energy and/or electrical energy using wet photoelectrochemical cells is described. Emphasis is on (1) the photoelectrolysis of H2O to H2 and O2 using cells having n-type semiconductor photoelectrodes fabricated from TiO2, SnO2, SrTiO3, KTaO3, and KTa(0.77)Nb(0.23)O3, and (2) the conversion of light to electrical energy using CdSe- and CdS-based cells with polysulfide electrolytes.