Cannabis is a complicated and controversial topic among followers of Islam, mainly because neither their holy book, the Qur'an, nor their Prophet Muhammad (the chosen messenger of their God, Allah) directly address whether using the herb is proper or not. Some Muslims consider marijuana “ḥalāl” (which means “permissible") and acceptable for responsible recreational use, while others think that cannabis is a narcotic that we should only use in cases of medical need.
The modern Islamic world is vast, and many ancient tribal cultures exist throughout Africa, Asia, and Europe that have traditions of using cannabis that predate the religion's presence. In fact, the practice of using marijuana is so well-steeped in some areas that the prospect of its complete prohibition impossible, even though some Muslim-majority countries enforce some of the harshest punishments for drug crimes. For instance, followers of Sufism (a mystical movement within Islam) openly consumes cannabis as part of their ritual practices and to reach higher states of consciousness.
However, most Islamic scholars and religious authorities make the argument that because marijuana has intoxicating effects on one's state of mind and sensory perception that its status as “haram” (religiously forbidden) is unquestioned. They cite the hadith (an Arabic term for a report or saying) of Muhammad that says “If much intoxicates, then even a little is haraam" and claim that since cannabis alters our consciousness and exhibits various effects over our minds and bodies that it meets the standards as “khamr” - an intoxicant.
The exception to this view is that the use of cannabis as a medicine is acceptable, under a physician's guidance and supervision, just as the use of opium is permissible under necessary circumstances. Most Muslims would not consider using cannabis to treat a valid medical ailment a sinful act, but rather a necessary step to regaining one's health.
In the end, it's almost impossible to make a general statement about how the Islamic religion “feels” about cannabis, as much of the arguments both for and against marijuana use are based on personal interpretation. The discussion continues among Muslims about whether they believe that cannabis is permissible to use, or not.