Crepuscular rays occur when objects such as mountain peaks or clouds partially shadow the sun's rays. The name crepuscular means "relating to twilight" and these rays are observed at sunrise and sunset. Crepuscular rays appear to diverge outward from the setting sun, and are visible only when the atmosphere contains enough haze or dust particles so that sunlight in unshadowed areas can be scattered toward the observer.
Photograph by: Holle
The light rays are actually parallel, but appear to converge to the sun due to "perspective", the same visual effect that makes parallel railroad tracks appear to converge in the distance. Crepuscular rays are often red or yellow in appearance because blue light from the sun is selectively scattered out of the beam by air molecules.
Light rays scattered by dust and haze occasionally appear to converge toward the "antisolar" point, (the location on the horizon opposite the point where the sun is setting). These rays, called anti-crepuscular rays, originate at the sun, cross over the sky to the opposite horizon, and appear to converge toward the antisolar point because of perspective.
Photograph by: Mckee
In the photo above, the sun is near the horizon behind the observer and sunlight is reflecting off the small cloud in the top right corner of the picture. Mountains and clouds behind the observer are responsible for the shadows in between.