
Sleeping pills are hypnotics, and thus their primary function is to induce sleep and to be used in the treatment of insomnia. The total sleep time is typically increased on average by 12 minutes if taken in the recommended doses, and the sleep onset time is reduced on average by about 13 minutes.
For mild cases of insomnia, over the counter antihistmines (like Claritin and Zyrtec, commonly taken for allergy symptoms) have a sleep inducing effect.
The doctor can prescribe various pills for severe or chronic insomnia, so called imidazopyridines, benzodiazepines, cyclopryrrolones etc., which act on the GABA neurotransmitters in the brain (resulting in sedative, sleep-inducing, anti-anxiety, anticonvulsant, muscle relaxant and amnesic action). Drugs that fall in this category are Oxazepam, Zaleplon, Diazepam, Zolpedim etc.
Ideally the lowest effective dose should be used, discontinuing the medication gradually. They can otherwise lead to addiction, which only aggravates insomnia. Even after a short period of usage, the first night without pills will be affected by the withdrawal syndrome and thus the patient will experience sleep difficulties. Also, daytime performance can become worse. For instance, sleeping pill users have more car accidents than non-users. The plot below shows that with the short acting drugs, most effect is gone a few hours after the start of sleep. Thus they don’t help you very much to stay asleep towards the morning. The long acting drugs on the other hand persist in the blood sometimes 24 hours, which affects the brain cells during the day (you can get a hangover). They can also lead to reversible amnesia in elderly patients.

Strong sleeping pills (or an overdose) can prove fatal indirectly if a medical emergency occurs (for instance if the patient’s airwaves get obstructed during sleep) and the patient cannot wake up.
Other side effects of benzodiazepines and the like include hallucinations, unpleasant taste, dry mouth, depression and an increased risk of viral infections. People that take strong sleeping pills every night have a 24% higher mortality that people that don’t and thus pills are meant for short term use (for instance during travel) only.
Melatonin agonists (drugs that act on melatonin receptors in the brain), like Ramelteon (which is more effective than melatonin itself) can also be prescribed. They have less efficiency than benzodiazepines, but on the other hand are less likely to produce addiction and hangover.
Finally, 5-HTP is a dietary supplement used for sleep disorders, depression, anxiety, migraine. Don’t use 5-HTP until more is known. 5-HTP might be UNSAFE, unfortunately it is freely available without prescription. Some people who have taken it have come down with eosinophilia-myalgia syndrome, a serious condition involving extreme muscle tenderness and blood abnormalities. 5-HTP works in the brain and central nervous system by increasing the production of the chemical serotonin. Serotonin can affect sleep, appetite, temperature, sexual behavior, and pain sensation. 5-HTP can lead to serious side effects when taken together with other pills and substances, including alcohol.
References: DarkSideOfSleepingPills.com; webmd.com
