"Huddled in a flock that had given up hope
in the welcome appearance of Quzah's companions..."
[...] The rainbow is called al-dah ["The Gewgaw"], as in the proverbial expression: "He doesn't know al-mah from al-dah." Al-mah is an egg yolk, and al-dah is a name for the rainbow. Al-dah also names the celestial halo seen mostly at night, and less frequently during the rising and setting of the sun. All such halos are caused when the light of a heavenly body meets a large quantity of wet vapor in the air, and is bent and turned round in the air by that vapor. And that is how you come to see the halo effect.
It has been observed that rainbows are fleeting occurrences, seen mostly in late afternoon and early evening, and never in the morning. In the autumn they are most frequent, and in summer they do not occur. The double rainbow you might see is caused by the reflection of the sun's rays on a barrier of moist vapor, after the fashion of light in water, and its subsequent retroflection. And a rainbow may be seen at night (though rarely) when the light of the full moon is at its height.
The turbidity or clarity of the rainbow depends on the humidity of the air, which (prior to the air's turbidity or clarity) determines the clarity and brightness of its colors. This is analogous to the color of fire, which is red and turbid when the wood is damp, and clear yellow when the wood is dry. And so it is with the colors of the rainbow.
From The Book of Seasons and Places
by Ahmad ibn Muhammad al-Marzuqi (d. 1030 AD), ch. 33.