Photodetectors and solar cells