Lets take two points as givens. First: You know you shouldn't be staring at a laptop or phone in the hours leading up to bedtime. Second: You're doing it, anyway.

As appealing as good rest is, it often loses out to last-minute emails from don't-ever-seem-to-sleep work colleagues and the Web's endless supply of ridiculously cute cats. For this, we pay dearly, both with our Zs (studies have long linked the glare of devices to poor sleep), and our workplace performance.

When it comes to screens and slumber, I long ago switched into damage-control mode. There are software and gear-based solutions that promise to mitigate the effects of late-night phone, e-reader, and laptop sessions without forcing you to quit cold turkey.

To understand how, some (quick!) science: When you look at a bright screen, its glow essentially tricks your brain into thinking it is daytime and you should be awake and alert. "Because of the three to four billion years of evolution of light during the day and darkness at night, our body clocks are not expecting light at night,"says Randy Nelson, professor and chair at the Department of Neuroscience at Ohio State University Wexner Medical Center.

The culprits here are special cells in your eyes that sense light and then tell your brain to suppress the production of melatonin — a hormone that makes you sleepy.

But, as Nelson explained to me, these cells have a secret that you can use to your advantage: They don't respond to all light equally. While the cells mostly shrug off red and orange lights, they are seriously sensitive to the blue wavelengths that LCD screens send their way. To reduce the impact of digitally produced light, all you have to do is minimize how much blue reaches your baby blues.

One solution I've been using lately is a lightweight piece of free software called f.lux. The program, which is available for both Windows and Macintosh computers, automatically changes the color temperature of your monitor as the sun sets; the later it gets, the more blue light is filtered out. That means less harsh blue glare — and less subsequent staring at the ceiling while you wait for sleep to set in.

At first, using f.lux can be a bit off-putting. Videos and Web sites that were once full-colored suddenly radiate a vaguely orange hue. But the screen color changes gradually, and users can tweak just how much blue is filtered out. That makes it friendly for beginners easing into blue-less nights. It's not advised for graphic designers or anyone who needs a true sense of what colors look like, but for simple text and Web browsing, it's a pretty painless shift.

For me, the filtered screen considerably eases the eye strain of looking at a laptop at night. After a few weeks of using f.lux, I barely noticed that it was on. Since I first downloaded the software about a year ago, I've grown rather attached to it as a must-have piece of programming.

I'm not alone. According to its founders, the program has been downloaded more than 10 million times since it was first released in 2009. An iOS version of f.lux works only on jailbroken devices. (Apple is pretty strict about how third- party apps can tinker with settings such as the screen, so no luck finding it in the legit App Store.) Android users can download a similar program called Twilight to their mobile devices.

I've also been playing with a second way to bust the blues: blue-blocking glasses that strategically filter the offending wavelengths. I like the ones made by Gunnar Optiks, which makes a line designed specifically for looking at computer screens. They come in a variety of prescription and non-prescription styles that start at about $70. The specs have grown popular with gamers, among the heaviest screen-starers out there.

I have found that these glasses make it easier to see distinct shapes and words than does f.lux, which can sometimes cause objects to blend into the background, depending on their color. This solution also considerably softens the LCD's overall harsh glare, and, being glasses, are completely platform-agnostic: They are equally adept at de-blueing laptops, tablets, and phones.

Technology is starting to catch up with a problem it caused, and now there are tools that reduce the consequences of a bedtime check of e-mail. Still, be careful not to let that online session stretch too late into the night: They still haven't invented software that can erase the effects of getting only three hours of sleep.

This Week's Circulars