This isn't really a "hack" per se, but an app suggestion. I'm sure some of you may use programs like f.lux or Redshift on your desktop to automatically have your display become less blue as it gets to be later at night (since blue light has been shown to suppress melatonin production, which is what helps you get to sleep). There is a similar app for Android, called Lux Auto Brightness, by Vito Cassisi. It has great reviews, and I highly suggest you give it a try. Unfortunately, I have a device not supported by Lux (the Optimus S), so if that's the case for you as well, I recommend CF.lumen (which I will explain below).
CF.lumen relies on Chainfire3D Pro (which requires a rooted device) as a backend. CF.lumen itself is free, but Chainfire3D Pro costs $3.99. This is because CF.lumen relies on custom colors for NightMode, which is only supported by the Pro version of Chainfire3D. The app is made by the same people who make Chainfire3D, so obviously it integrates with it nicely. CF.lumen only works on Froyo/Gingerbread at this time, so keep that in mind.
(Note: To get Chainfire3D Pro, you first have to install Chainfire3D, and then install Chainfire3D Pro. Then you open up Chainfire3D and install the CF3D driver. It will reboot your device, and you can then install CF.lumen. Also, Chainfire3D claims to require devices with at least a 1Gz processor, but I've used it on the Optimus S with zero problems so far. If you're worried, just make a nandroid backup before you install it.)
CF.lumen gives you the option to set three different color filters, one for daytime, one for sundown, and one for sleep time. You let it discover your location, and then the Sundown Color Filter will automatically be triggered once the sun goes down in your area. The Sleep Color Filter is meant to be used while you are sleeping, so you just set your Sleep Start Time and Sleep End Time settings to correlate with when you are typically sleeping.
For my color filters, I chose to use Kelvin temperatures, since I found those the most intuitive, but you can also choose from among several color presets or use custom RGB values. I set my Day Color Filter to 5000K (which is slightly less blue than the default LCD, but closer to the color temperature of the actual sun), my Sundown Color Filter to 2500K (which is the lowest I could get the temperature and still be able to play color-related games such as Flow Free), and my Sleep Color Filter to 1000K (which is the lowest temperature and contains no blue or green). Your mileage may vary, so you'll want to play with the settings and see what you are most comfortable with.
As an alternative, if you're absolutely dead set on not paying anything, the free version of Chainfire3D still has the NightMode option, and I've found their Red and Amber color presets to work nicely for nighttime viewing. You just go into Chainfire3D, set either Amber or Red as your NightMode color, then place the Toggle NightMode shortcut on your homescreen (which you can either do within the app itself, or by long-pressing on your screen, selecting Shortcuts, and selecting the toggle from within there). Then when it gets to be later at night, you press the toggle, and voila! Instant nightmode!
As a final addition, if you also like to make your screen very dim at night and/or disable softkey backlights, you can use apps such as Screen Filter in combination with CF.lumen to do this. I use this combo and it works out nicely.
If you're REALLY sensitive to blue light at night, I advise supplementing this with products from LowBlueLights (they make blue-blocking glasses, amber LED nightlights and more) and getting LED light dimmers/blockers from Lightdims (http://www.lightdims.com/store.htm).
So in conclusion, if you have a device that supports Lux, that looks like the best (and cheaper) solution. But if you have a rooted device and it's not supported by Lux, give CF.lumen a try. It's a pretty nice app. :D