A new approach for improving solar cells, photocatalysts, light sensors and other optoelectronic devices