Fact 1: a rainbow is formed by refraction of light by separating light into all different colors. 
Fact 2: Light rays come in through the lens.
a rainbow is formed by refraction of rays by separating rays into all different colors.