The Messenger of Allah (may the blessings and peace of Allah be upon him) led the morning prayer for us at al-Hudaybiyah following rainfall during the night. When the Prophet (may the blessings and peace of Allah be upon him) finished, he faced the people and said to them : “Do you know what your Lord has said?” They said : “Allah and his Messenger know best”. He said : “This morning one of my servants became a believer in me and one a disbeliever. As for him who said : We have been given rain by virtue of Allah and His mercy, that one is a believer in me, a disbeliever in the stars (1); and as for him who said : We have been given rain by such-and-such a star, that one is a disbeliever in Me, a believer in the stars.”
(1) The pre-Islamic Arabs believed that rain was brought about by the movement of stars. This Hadith draws attention to the fact that whatever be the direct cause of such natural phenomena as rain, it is Allah the Almighty who is the Disposer of all things.
It is related by al-Bukhari (also by Malik and an-Nasa’i).