This can be caused by winds or mountains. Some deserts are near oceans. The Mediterranean Sea is near the Sahara desert. California is another good example of a desert by the sea. Deserts by bodies of water are usually caused by winds.
Mountains also play a roll in forming deserts.
A good place to find plenty of mountains jumping up in front of innocent clouds is by the Himalayas. A cloud trying to visit his relatives in Mongolia might run into the Himalayas. Being a very angry cloud, he would drop all of his rain right on India, leaving everything behind the Himalayas, like the Gobi desert dry. When most people think of the desert, they think of camels, snakes and lizards as being the only animals that live in the desert. Really, there are many more animals living in the desert.