I am asking this question intrigued by the fact that in certain religious books (mostly Arabic) it is stated that rain and hail comes from the sky (heaven) and not from Earth. They probably did not know that rain and hail comes from clouds. My question is when did many understand this fact?
I have seen a lot of rain and a bit of hail, and it almost always came from above, i.e. from the sky. Indeed, my country's official meteorological agency agrees that rain and hail really come from the sky or maybe from heaven ("Himmel" in German can mean both).
Aristotle had already figured out most of the physics of rain before 322 BCE. His works were translated into Arabic by about 800 CE and into Latin (again?) in the 12th century.
Given that the formation of (thin) fog from warm water is easily observable in many kitchens and bathrooms, and that the formation of drizzle and rain from fog and clouds is easily observable when taking a walk on a rainy day in the mountains, Aristotle may have been not the first to reach such conclusions.
Aristotle's main problem in his explanation of rain seems to have been his (lack of) understanding of chemistry, but the physics are quite sound. Clouds are some form of condensated water, water evaporates when it is warm and condensates to clouds when it is colder. When it gets even colder, the clouds will start to rain. The whole thing is a cycle.
The exhalation of water is vapour: air condensing into water is cloud. Mist is what is left over when a cloud condenses into water, and is therefore rather a sign of fine weather than of rain; for mist might be called a barren cloud. So we get a circular process that follows the course of the sun. For according as the sun moves to this side or that, the moisture in this process rises or falls. We must think of it as a river flowing up and down in a circle and made up partly of air, partly of water. When the sun is near, the stream of vapour flows upwards; when it recedes, the stream of water flows down: and the order of sequence, at all events, in this process always remains the same. So if ‘Oceanus’ had some secret meaning in early writers, perhaps they may have meant this river that flows in a circle about the earth.
So the moisture is always raised by the heat and descends to the earth again when it gets cold. These processes and, in some cases, their varieties are distinguished by special names. When the water falls in small drops it is called a drizzle; when the drops are larger it is rain.
His explanation of hail, however, explicitely rejects a theory (by Anaxagoras) which is closer to our current understanding, because (paraphrasing) "hailstones are not round". However, Aristotle's discussion of a theory which he rejects also shows us that already back then an explanation for hail existed which is somewhat similar to our modern understanding: Hailstones can be formed when the clouds reach up into cold regions of the atmosphere.
Some think that the cause and origin of hail is this. The cloud is thrust up into the upper atmosphere, which is colder because the reflection of the sun’s rays from the earth ceases there, and upon its arrival there the water freezes. They think that this explains why hailstorms are commoner in summer and in warm countries; the heat is greater and it thrusts the clouds further up from the earth. But the fact is that hail does not occur at all at a great height: yet it ought to do so, on their theory, just as we see that snow falls most on high mountains. Again clouds have often been observed moving with a great noise close to the earth, terrifying those who heard and saw them as portents of some catastrophe. Sometimes, too, when such clouds have been seen, without any noise, there follows a violent hailstorm, and the stones are of incredible size, and angular in shape. This shows that they have not been falling for long and that they were frozen near to the earth, and not as that theory would have it. Moreover, where the hailstones are large, the cause of their freezing must be present in the highest degree: for hail is ice as every one can see. Now those hailstones are large which are angular in shape. And this shows that they froze close to the earth, for those that fall far are worn away by the length of their fall and become round and smaller in size.
It clearly follows that the congelation does not take place because the cloud is thrust up into the cold upper region.
From Summa Theologica of St. Thomas Aquinas:
Rain and winds, and whatsoever occurs by local impulse alone, can be caused by demons. It is a dogma of faith that the demons can produce winds, storms, and rain of fire from heaven 1,2
For this reason, whenever severe weather threatened, the best response was thought to be to ring the church bells or fire cannons to frighten off the demons. Sprinkling of Holy water, praying, and other such liturgical remedies were also done to try to drive the demons away.
1 See Thomas Aquinas, "Summa," pars I, qu. lxxx, art. 2, cited by Maury, "Légendes Pieuses," 11. The second citation I owe to Rydberg, "Magic of the Middle Ages," 73, where the whole interesting passage is given at length.