The Economist covers the struggle of being an atheist in Muslim countries:
In a handful of majority-Muslim countries atheists can live safely, if quietly; Turkey is one example, Lebanon another. None makes atheism a specific crime. But none gives atheists legal protection or recognition. Indonesia, for example, demands that people declare themselves as one of six religions; atheism and agnosticism do not count. Egypt’s draft constitution makes room for only three faiths: Christianity, Judaism and Islam.
Sharia law, which covers only Muslims unless incorporated into national law, assumes people are born into their parents’ religion. Thus ex-Muslim atheists are guilty of apostasy — a hudud crime against God, like adultery and drinking alcohol. Potential sanctions can be severe: eight states, including Iran, Saudi Arabia, Mauritania and Sudan have the death penalty on their statute books for such offences.