Yes, you are right. There are many medical applications of cannabis.
Some of the many uses and ailments include -
Cancer - painkiller, prevention/easing of nausea from chemotherapy, in some cases even killing cancer cells, one of my friend's wives has skin cancer which has now almost completely disappeared after daily use of cannabis oil.
Multiple sclerosis - my own wife suffers from this, benefits include - painkiller, eases muscle spasms/tremors, reduces the nerve inflammation which causes much of the harm done by MS.
Repetitive strain injury - eases pain and can prevent muscle spasms.
Autism/Aspergers - helps "normalize" brain function, allowing affected individuals to empathize more with others and lead fuller lives, effects on learning and memory from use on young individuals is not currently known however.
Insomnia - some strains of cannabis are very effective at inducing sleep and personally I have used it on several occasions for insomnia.
Various eating disorders - appetite stimulation.
There are many other uses of course, this is just a few, I certainly won't pretend there aren't side effects, there are, including - reduced short term memory, risk of psychosis in prone individuals, reduced brain function when used before the age of 18 (approximate age where the brain has fully developed) and a few other minor effects, but generally these risks are massively outweighed by the benefits, particularly when other common treatments for many of these conditions have much worse side effect profiles, also, the lethal dose for THC (the main active ingredient of cannabis) is so high it would be almost impossible to achieve, almost all known deaths linked to cannabis have been due to exacerbating pre-existing conditions.
Additionally, many of the beneficial medical effects are from CBD (cannabidol) which is not psychoactive, IE, will not get you high, the issue is it is very difficult to separate THC and CBD so most users of medical cannabis in areas where it is illegal have to find low THC, high CBD varieties, or put up with the high.