Many hadith mention the practice of casting lots during the time of the Prophet (may the peace and blessings of Allah be upon him). For example, when deciding which of the wives will accompany the Prophet on a journey, they would cast lots. Do we know how the casting of lots was done? Were the names pulled from a bowl, for example?
Praise be to Allah
A’ishah (may Allah be pleased with her) said:
When the Messenger of Allah (blessings and peace of Allah be upon him) wanted to travel, he would cast lots among his wives, and whichever one’s name was picked, he would take her with him.Narrated by Al-Bukhari (2593) and Muslim (2770)
This was due to his (blessings and peace of Allah be upon him) perfect fairness among his wives (may Allah be pleased with them) and his kindness towards them.
With regard to the way in which the casting of lots was done by the Prophet (blessings and peace of Allah be upon him), we have not come across anything that describes it clearly in any hadith, but the scholars have stated that he used to write the names of the people among whom lots were being drawn on leaves or the like, and put them in his lap, or in a vessel, then he would tell someone to take out one leaf, and the one whose name was drawn was the one who would be chosen.
Al-Hafiz Ibn Hajar (may Allah have mercy on him) said:
The way in which drawing lots was done was that the names would be written on things, and a stranger would make the draw; the one whose name was drawn was the one who would be chosen. End quote from Fath al-Bari (1/172). See also: al-Hawi by al-Mawardi (16/254)
There is nothing in Islamic teaching to specify a particular way of drawing lots, so however it is done is permissible.
Az-Zarkashi (may Allah have mercy on him) said:
However lots are drawn is permissible. End quote Sharh az-Zarkashi ‘ala Khuraqi (7/455)
Shaykh Ibn ‘Uthaymen (may Allah have mercy on him) said:
However lots are drawn, it is permissible, because there is no particular prescribed way of doing it. So reference should be made to whatever people agree upon. End quote Ash-Sharh al-Mumti‘ (2/55)
And Allah knows best.
Taken from IslamQA.info