Jet lag makes everyone miserable. But it makes some people mentally ill.

There’s a psychiatric hospital not far from Heathrow Airport that is known for treating bipolar and schizophrenic travelers, some of whom are occasionally found wandering aimlessly through the terminals. A study from the 1980s of 186 of those patients found that those who’d traveled from the west had a higher incidence of mania, while those who’d traveled from the east had a higher incidence of depression.

I saw the same thing in one of my patients who suffered from manic depression. When he got depressed after a vacation to Europe, we assumed he was just disappointed about returning to work. But then he had a fun trip out West and returned home in what’s called a hypomanic state: He was expansive, a fount of creative ideas.

It was clear that his changes in mood weren’t caused by the vacation blues, but by something else. The problem turned out to be a disruption in his circadian rhythm. He didn’t need drugs; he needed the right doses of sleep and sunlight at the right time.

It turns out that that prescription could treat much of what ails us.

Clinicians have long known that there is a strong link between sleep, sunlight and mood. Problems sleeping are often a warning sign or a cause of impending depression, and can make people with bipolar disorder manic. Some 15 years ago, Dr. Francesco Benedetti, a psychiatrist in Milan, and colleagues noticed that hospitalized bipolar patients who were assigned to rooms with views of the east were discharged earlier than those with rooms facing the west — presumably because the early morning light had an antidepressant effect.

The notion that we can manipulate sleep to treat mental illness has also been around for many years. Back in the late 1960s, a German psychiatrist heard about a woman in Tübingen who was hospitalized for depression and claimed that she normally kept her symptoms in check by taking all-night bike rides. He subsequently demonstrated in a group of depressed patients that a night of complete sleep deprivation produced an immediate, significant improvement in mood in about 60 percent of the group.

Of course, total sleep deprivation is impractical, to say nothing of the fact that you will crash back into depression as soon as you catch back up on sleep. It also just seems counterintuitive that taking sleep away can help someone feel better. After all, most of us think of sleep as comforting and desirable. So how does this work?

One theory is that depressed people have something wrong with their circadian rhythm. Their bodies tend to release melatonin — a hormone that regulates sleep — earlier in the evening than non-depressed people, and they tend to wake up earlier in the morning.

But even if you don’t have depression, your circadian rhythm may cause trouble. Most people’s natural cycle is somewhat longer than the 24-hour solar day, which means that, left to our own devices, we would quickly get out of sync with the external world. That is exactly what happens when humans are isolated from external cues — say, in a lab setting or stuck in a mine.

The reason we don’t all walk around in a state of perpetual jet lag, waking and sleeping at random, is that our circadian rhythm evolved to be tied to the solar day. In other words, our internal clock is easily influenced and kept in check by the daylight cycle.

I started thinking about this a few years ago, on a red-eye flight from New York to Rome, when I was rudely awakened somewhere over the Atlantic by the familiar airline ritual of opening the shades to blinding early-morning sunlight. What, I wondered, was this light doing to my brain?

When you quickly cross several time zones, your circadian rhythm remains stuck in the city you left behind. Arriving in Rome with your New York City brain is what produces the unpleasant symptoms of jet lag: fatigue, malaise, poor concentration and mood changes.

When you leave New York at 6 p.m., the Italians are probably in bed asleep. But you won’t feel ready for sleep until around 11. To make the right adjustment, you need to shift your internal clock earlier by six hours.

Unfortunately, exposure to light in the middle of the night will do the opposite. Instead of shifting you earlier to Italian time, it makes you feel it’s even later — that the night is over and it’s already morning.

If you’re ever in that situation, close the shades and put on dark sunglasses. Keep the glasses on until lunchtime in Rome — or 7 a.m. back home. Then go out into the sun, have an espresso and enjoy the splendor of the ancient city. This will shift your clock closer to Roman time.

The clock in your brain doesn’t just take cues from light, but from the hormone melatonin as well. Every night, about two to three hours before you conk out, your brain starts to secrete melatonin in response to darkness. Taking a melatonin supplement in the evening will advance your internal clock and make it possible to fall asleep earlier; taking it in the morning will do the opposite. (You might assume this would make you even more tired during the day but it won’t; you could think of it as tricking your brain into believing you slept longer.)

So now you know the fix for jet lag: Travel east and you’ll need morning light and evening melatonin; go west and you’ll need evening light and morning melatonin.

The same principle tells us what to do for night owls, the 5 percent to 10 percent of adults who don’t start releasing melatonin until late. If they try to sleep at a normal hour, like 11 or midnight, they will have “insomnia,” because they don’t feel sleepy yet — their natural circadian rhythm is delayed.

Many will take sleeping pills, which cannot fix the underlying cause. It would be more effective to take a small dose of melatonin a few hours before the desired bedtime. They could also try a treatment called chronotherapy, which alters the circadian rhythm. This involves exposure to bright lights at progressively earlier times in the morning, which should make it easier to fall asleep earlier. Finally they should avoid too much light in the evening, especially the blue light that smartphones and computers emit. (Or they can wear glasses that block blue light.)

I started thinking about this a few years ago, on a red-eye flight from New York to Rome, when I was rudely awakened somewhere over the Atlantic by the familiar airline ritual of opening the shades to blinding early-morning sunlight. What, I wondered, was this light doing to my brain?

When you quickly cross several time zones, your circadian rhythm remains stuck in the city you left behind. Arriving in Rome with your New York City brain is what produces the unpleasant symptoms of jet lag: fatigue, malaise, poor concentration and mood changes.

When you leave New York at 6 p.m., the Italians are probably in bed asleep. But you won’t feel ready for sleep until around 11. To make the right adjustment, you need to shift your internal clock earlier by six hours.

Unfortunately, exposure to light in the middle of the night will do the opposite. Instead of shifting you earlier to Italian time, it makes you feel it’s even later — that the night is over and it’s already morning.

If you’re ever in that situation, close the shades and put on dark sunglasses. Keep the glasses on until lunchtime in Rome — or 7 a.m. back home. Then go out into the sun, have an espresso and enjoy the splendor of the ancient city. This will shift your clock closer to Roman time.

The clock in your brain doesn’t just take cues from light, but from the hormone melatonin as well. Every night, about two to three hours before you conk out, your brain starts to secrete melatonin in response to darkness. Taking a melatonin supplement in the evening will advance your internal clock and make it possible to fall asleep earlier; taking it in the morning will do the opposite. (You might assume this would make you even more tired during the day but it won’t; you could think of it as tricking your brain into believing you slept longer.)

So now you know the fix for jet lag: Travel east and you’ll need morning light and evening melatonin; go west and you’ll need evening light and morning melatonin.

The same principle tells us what to do for night owls, the 5 percent to 10 percent of adults who don’t start releasing melatonin until late. If they try to sleep at a normal hour, like 11 or midnight, they will have “insomnia,” because they don’t feel sleepy yet — their natural circadian rhythm is delayed.

Many will take sleeping pills, which cannot fix the underlying cause. It would be more effective to take a small dose of melatonin a few hours before the desired bedtime. They could also try a treatment called chronotherapy, which alters the circadian rhythm. This involves exposure to bright lights at progressively earlier times in the morning, which should make it easier to fall asleep earlier. Finally they should avoid too much light in the evening, especially the blue light that smartphones and computers emit. (Or they can wear glasses that block blue light.)

Richard A. Friedman/The New York Times

Follow Core Spirit