Maliks Muwatta Book 013, Hadith Number 001.

Section : How to Ask for Rain.

Yahya related to me from Malik from Abdullah ibn Abi Bakr ibn Amr ibn Hazm that he had heard Abbad ibn Tamim say that he had heard Abdullah ibn Zayd al-Mazini say, "The Messenger of Allah, may Allah bless him and grant him peace, came out to the place of prayer and asked for rain, and when he faced the qibla he turned his cloak inside out."

Malik was asked how many rakas there were in the prayer of asking for rain and he said, "Two rakas, and the imam does the prayer before he gives the khutba. He prays two rakas, and then he gives a khutba and makes dua, facing the qibla and turning his cloak inside out. He recites out loud in both rakas, and when he turns his cloak inside out he puts what is on his right on his left, and what is on his left on his right, and all the people turn their cloaks inside out when the imam does so, and face the qibla, sitting."