According to the Shariah anyone can be an atheist and they can to an extent criticize muslims.But it is against the Shariah to make derogatory remarks against God or the Prophet(PBUH).It is considered as blasphemy.The highest penalty for blasphemy is execution.Muhammad ibn Zakariya al-Razi(the famous physician) was a free-thinker or probably an atheist.He wrote books that criticized Islam and the Prophet(PBUH).Al-Biruni and Ibn-Sina were against him for this reason.But Al-Razi never made any derogatory statements.There is a difference between criticism and slander.If we were in an Islamic state this guy might have been execuetd if he did not apologize.But I won't say that this particular murder is justified!