Melatonin, a hormone, is sold over-the-counter in the US and Canada.
Bedtime is a good time to take melatonin
Clinical psychologist Michael Breus writes:
Melatonin is a sleep and body clock regulator, not a sleep initiator. ... Caution should be taken when using melatonin ... It should be taken about 90 minutes before lights out.
An endocrinologist named Richard Wurtman writes:
We investigated whether giving older people melatonin at bedtime as a 'hormone replacement therapy' (i.e. providing them with a dose sufficient to restore nocturnal plasma levels to those of young adults) would also suppress nocturnal awakenings and shorten the time needed to resume sleeping. ... 0.3–1.0 mg, [the doses] which raise plasma melatonin levels to the range that normally occurs nocturnally in young people, was found to help the patients to remain asleep or readily fall back asleep throughout most of the night.
Imagine this scenario: Once a month or so, a healthy young adult wakes up after five hours of sleep and has trouble falling back asleep. When this happens, he finds that taking a small dose (between 0.5 mg and 1 mg) of immediate-release melatonin seems to usually help him to fall back asleep an hour later.
Fine; he finds it helpful. But is it safe? Dr. Breus says melatonin should be taken before bedtime. And Dr. Wurtman seems to have studied the use of the tablets close to bedtime — not in the middle of the night. [Edit: Hormones are powerful substances which may have short-term or long-term side effects which we're unaware of. Dr. Breus seems to be implying that melatonin can be used for delayed sleep phase disorder but should not be used for ordinary insomnia. I wonder whether or not it is truly safe to swallow hormones to help deal with these awakenings.]
(I added this postscript to my question on May 19.)
I looked at Wikipedia's "Middle-of-the-night insomnia" article today, and noticed that it adds a good insight:
Sleep research conducted already in the 1990s showed that such waking up during the night is in fact a natural sleep pattern that is actually beneficial, rather than a form of insomnia. If interrupted sleep (called "biphasic sleeping" or "bimodal sleep") is perceived as normal and not referred to as "insomnia", less distress is caused and a return to sleep usually occurs after about one hour.
Instead of taking a hormone pill (melatonin), perhaps our subject should preferably just wait an hour and then try again to fall back asleep.