How to perform Rami
"Rami Jamaar" (stoning) is Wajib in Haj. The "Jamaraat," which are stoned, are to be stoned each 7 times. This is an article of Rami. However, it is done if the "Jamaraat" are stoned 4 times or more. If they are stoned 3 or less times, then this is not valid.
If someone has done it 3 times, then Dam (sacrifice) is Wajib on that Haji, in the same way as it is Wajib on someone, who has not done it all. If it is re-performed 7 times, then Dam is not Wajib. In the same way, if it is done 4 or more times, then Dam is not Wajib, but in lieu of every missed turn, 1 Sadqa Fitr is Wajib.
The first thing to be done on reaching Mina from Muzdalifa is Rami. On 10th of Dhul Hijjah, perform the Rami of only "Jamrah 'Aqaba" (the big devil). Before casting the first stone on "Jamrah 'Uqba," stop the Talbiya.
It is Wajib to perform the Rami of all the Jamrahat (Jamrah Aula, JamrahWusta and Jamrah 'Aqaba) on the 11th and 12th Dhul Hijjah. First Rami should be performed of the Jamrah Aula (small devil). After Rami move a little forward and raise the hands and pray. Recite the praises of Allah (Subhanahu Wa Ta'ala) and send Durud to the presence of the Holy Prophet (Sallallahu alaihi wa sallam). If possible, wait there for the time it takes to recite 20 verses of the Holy Quran or else as circumstances allow. Then the Rami of Jamrah Wusta (moderate devil) is to be performed and remain in Du'a, praise of Allah (Subhanahu Wa Ta'ala), Durud for either the time takes to recite 20 verses of the Holy Quran or as much as possible. Then the Rami of Jamrah 'Aqaba is to be performed. After this, there is no Rami, so neither wait nor pray, but move on.
If one goes to Makkah after the Rami of 12th Dhul Hijjah before sunset, then there is no problem, but it is Masnoon (established by the Sunnah) to perform the Rami of 13th and then go. Going after sunset is Makruh and if still in Mina on the morning of the 13th, then Rami is Wajib and it is not permissible to go without performing Rami. In this case, on the 13th also, Rami should be performed in the same manner, as described above. The time for this Rami is from morning to Maghrib, but it is Masnoon to perform it at midday (Dhawaal)
Dua to be recited while performing Rami:
بِسْمِ اللَّهِ وَاَللَّهُ أَكْبَرُ رَغْمًا لِلشَّيْطَانِ وَرِضیً لِّلرَّحْمنِ اللَّهُمَّ اجْعَلْهُ حَجّاً مَبْرُورًا وَذَنْباً مَغْفُورًا وَسَعْياً مَشْكُورًا-I start with the name of Allah (Subhanahu Wa Ta'ala), who is very great. I perform Rami to debase Satan and to please Allah (Subhanahu Wa Ta'ala). O Allah! Make this Haj accepted (Mabroor), forgive the sins and accept the efforts made in Your path
Time for Rami:
The Masnoon time for Rami is from dawn to midday (Dhawaal), the Mubah (permissible) time is from Dhawaal to sunset and the Makruh time is from sunset to the morning. Thus, it is Mustahab (commendable) to perform Rami before midday. It is permissible to perform Rami from Dhawaal to sunset and it is Makruh (undesirable) to perform it from sunset to the next morning.
What to do if there is doubt about the number of stones thrown:
There is no problem if anybody is in doubt as to the number of pebbles in Rami and uses one more stone, even though he/she had already thrown 7 stones. Deliberately performing it more than twice is Makruh Tanzeehi (Undesirable). As given in Manasik Mulla Ali Qari Ma'a Haashiya Irshad Us Sari, Pg No. 275/277.