Uninterrupted Power Supplies (UPS) allow you preserve your equipment, and prevent data loss when the electricity goes out. Acting as a fancy power bar, it has a built-in rechargeable battery that can give you some 10-15 minutes of power in case of a power failure, enough to save your files safely, and shut down your computer.
I own two APC Back-UPS. The first one has a LCD screen and plugs in the computer via USB to provide better control and cooperation between the two. I plug in my desktop computer, USB drive, and anything valuable on this one. The second is smaller and I use it more for laptops and smaller peripherals.
The ones I have are similar to these two (Adorama links):