Excerpt from The Jewish Standard (Apr 27, 2012):
Medical marijuana is used to treat patients with AIDS and those receiving chemotherapy — both of which are life-threatening scenarios — as well as those suffering from glaucoma, which Jewish law regards as equally hazardous. In fact, serious eye injury/disease was the only condition that was always regarded as “dangerous” because of the connection between the optic nerve and the brain. If one must violate the laws of Shabbat or of kashrut in such situations, Jewish law could also sanction an otherwise illegal drug, such as marijuana. In non life-threatening situations (e.g. chronic back pain, migraine headaches, etc.), medical marijuana might also be sanctioned by Jewish law if no other effective remedy is available. This is based on the concept that the halachic obligation/understanding of healing is not limited only to saving lives, but extends to the alleviation of pain and suffering, as well.