Anas Hlayhel wrote a helpful and short piece on how Muslims can respond when the prophet Mohammad is mocked, “Mocking the Prophet, How Should We React?“. It is well reasoned and rooted in the Qur’an. Here is a short outline:
1. Mockery is equivalent to ignorance.
2. Ignore the ignorant (i.e. the foolish), but engage and even debate the reasonable.
3. Allah will take care of the mocker, so you don’t need to.
4. Respect other faith symbols, even idols, lest others disrespect Islam.
Please read the whole thing in order to see the Qur’anic reasoning behind his points.