Earth's atmosphere works as a prism, separating sunlight into its constituent colors, especially at sunrise or sunset, when the rays of sunlight are travelling almost exclusively through our thin atmosphere. The wavelength of blue light scatters more than the other prismatic colors - that is why we perceive the sky as being blue.
The various colors of light refract in different degrees based on their wavelengths; shorter wavelengths (blue, violet, and green) refract more strongly than longer wavelengths (yellow, orange, and red). As such, blue and violet light is scattered by water in the atmosphere while red, orange, and yellow are absorbed, leaving the green light the most visible during the very last few seconds when the sun sets below or rises above the horizon.
This two to three-second phenomenon is best observed with binoculars or, as in the case above, a telephoto lens and sturdy camera.