When light with photo energy greater than the band gap value falls on a p-n junction, electron hole pairs are generated and built in barrier separates them from recombination. The separation of carriers produces a forward voltage across the junction. This voltage is called forward as it is opposite of built in voltage. This effect is known as Photovoltaic effect.
An illuminated junction can deliver current into an external circuit. Large area p-n junctions of Silicon are used to convert solar energy to electrical energy. These are called Solar cells.