Lunesta is a sedative or sleeping medicine used to treat sleeping problems (such as trouble falling asleep, trouble staying asleep during the night, or waking too early in the morning). Lunesta may also be used to treat other conditions as determined by your doctor.