Surface photovoltage spectroscopy of thin films