In Islam, we follow the laws of the Noble Quran, and the Sayings of Prophet Muhammad peace be upon him. If a situation or case is not addressed in neither the Noble Quran, or the Sayings of our beloved Prophet, then we follow the local verdicts of our Religious Authorities, where they would decide based upon the cultural and social situation and causes.
Allah Almighty said in the Noble Quran:
"O ye who believe! Obey God, and obey the Apostle, and those charged with authority among you. If ye differ in anything among yourselves, refer it to God and His Apostle, if ye do believe in God and the Last Day: That is best, and most suitable for final determination. (The Noble Quran, 4:59)"
"When there comes to them some matter touching (Public) safety or fear, they divulge it. If they had only referred it to the Apostle, or to those charged with authority among them, the proper investigators would have Tested it from them (direct). Were it not for the Grace and Mercy of God unto you, all but a few of you would have fallen into the clutches of Satan. (The Noble Quran, 4:83)"
Since the punishment for rape doesn't exist in the Noble Quran, but exists in the Sayings of our beloved Prophet peace be upon him, then the verdict or law for punishing the rapist according to Noble Verses 4:59 and 4:83 above must come from our beloved Prophet's Sayings.
Let us look at what Prophet Muhammad peace be upon him said regarding this issue:
The following information was sent to me by a Muslim; may Allah Almighty always be pleased with him.
Let us look at how Prophet Muhammad peace be upon him dealt with the rapists:
Narrated Wa'il ibn Hujr:
"When a woman went out in the time of the Prophet (peace_be_upon_him) for prayer, a man attacked her and overpowered (raped) her. She shouted and he went off, and when a man came by, she said: That (man) did such and such to me. And when a company of the Emigrants came by, she said: That man did such and such to me. They went and seized the man whom they thought had had *********** with her and brought him to her.
She said: Yes, this is he. Then they brought him to the Apostle of Allah (peace_be_upon_him). When he (the Prophet) was about to pass sentence, the man who (actually) had assaulted her stood up and said: Apostle of Allah, I am the man who did it to her.
He (the Prophet) said to the woman: Go away, for Allah has forgiven you. And about the man who had *********** with her, he said: Stone him to death.
He also said: He has repented to such an extent that if the people of Medina had repented similarly, it would have been accepted from them. (Sunan Abu Dawud, Book 38, Number 4366)"
Some Muslims do not believe in this Saying as an authentic one, because it didn't come from a "Sahih" (authentic in English) source. It came from "Sunan Abu Dawud". Sayings of our Prophet's companions and wives narrated in "Sunan Abu Dawud" are indeed authentic. But Sayings from other people such as Wa'il ibn Hujr above are doubtful. The only volumes that had been double and triple checked and are absolutely authentic to the Muslims are the "Sahih" volumes as I mentioned. With "Sunan Abu Dawud" we have to be extra careful, for it contains truthful and untruthful narrations about our Prophet peace be upon him.