I suspect it has to do with the difference in size of a rain drop and that of the water particles in the cloud.
It really depends on the cloud. Actually, it depends on its density and thickness which is related to concentrations and type of hydro-meteors in it, the size distribution of water droplets and ice crystals, and shape of ice crystals.
Rainbows are formed by the refraction and internal reflection of light in water drops (usually rain).
But cirrostratus clouds can form a halo by refraction on ice crystals in shape of hexagonal prisms. These halos have angular radius of about 22 degrees.
Another optical phenomena that you might find interesting is a corona around the Sun or the Moon which is caused by diffraction of light on water droplets and tiny ice crystals. Angular size of a corona depends on the size of water droplets.
'Areas of darkness' are due to the density and optical thickness of a cloud. More ice crystals and water droplets cause more scattering which results in less light reaching your eyes making a cloud appear darker.
Not an expert but I believe it has something to do with water vapor vs water droplets.
When you were in elementary school and used a prism to produce a color spectrum the prism was a clear solid, somewhat like a water drop is a clear liquid. Reflectivity occurred with that mass and produced a color spectrum. When this occurs within rain it is called a RAINBOW!