There is no punishment in Islam for blasphemy. No such punishment is prescribed in the Holy Quran, or in any of the traditions of the Prophet Muhammad(sa). Islam promotes the need for respect of all religions for the sake of peace in society, but it does not set out any punishment for blasphemy despite the offence it may cause people of faith.
We have evidence in the traditions of the Holy Prophet(sa) where Abdullah bin Ubayyee (Chief of the hypocrites) continuously abused the Prophet(sa), and opposed him severely in Madinah.
When he passed away, the Prophet(sa) stood to offer his funeral prayers but was asked by one of his companions, “O Allah’s Apostle! Do you offer the prayer for this man although he said so-and-so on such-and-such-a day?” and “that he is a hypocrite!”. The Prophet(sa) ignored his statements and continued to offer the funeral prayers of the dead man. (Sahih Bukhari, Volume 6, Book 60, Number 192)
The above example shows that the Prophet(sa) never ordered any punishment for anyone who insulted or abused him or God; on the contrary he went to pray for them that they be guided aright. Much has been written on this subject, for further details, please see the book ‘Murder in the Name of Allah’.
If somebody uses foul language against any holy person or teaching, Islam advises to keep away from such people as The Holy Qur’an says,
And when you see those who trifle with our signs then turn thou away from them until then engage in a discourse other than that and if Satan cause thee to forget then sit not, after recollection, with the unjust people. (Ch.6: V.69)