The diamond ring effect is a feature of total solar eclipses. Just before the sun disappears or just after it emerges from behind the moon, the rugged lunar limb topography allows beads of sunlight to shine through. This effect is called Baily's beads, in honor of Francis Baily who first noted the phenomenon in 1836.
The smoothness of the lunar topography is interrupted by mountains, craters, valleys, etc, and the lunar limb profile is known accurately from grazing occultations of stars, so it is possible to make fairly good advance determinations of which mountains and valleys will cause the beads to appear. While Baily's beads are seen for a few seconds at the central path of the eclipse, they are visible longer near the margins of the path of totality.
The diamond ring effect is seen when only one bead is left; a shining diamond set in a bright ring around the lunar silhouette.[1]
Cosmas Damian Asam was probably the earliest realistic painter to depict a total solar eclipse and diamond ring.[2] His painting was finished in 1735.
It is not entirely safe to view Baily's beads or the diamond ring effect without proper eye protection because in both cases the photosphere is still visible.