Beginning in Lion (10.7), there's a new feature in Mac OS X to assist you if things go really wrong, since you can't boot from disk anymore. This new feature is called Recovery, and it gives you a way to start "from scratch" if you need to rebuild your Mac.
There are a couple of methods for doing this, which both lead to the same place: A USB drive (8GB or larger), safely stashed in a drawer, which has a bootable OS on it, as well as an installer to put that OS on a hard drive.
First up is the "official" method, a utility introduced with Mavericks, called Recovery Disk Assistant. This works with Lion, Mountain Lion, and Mavericks, all the versions of Mac OS that were distributed via the Mac App Store.
An alternate method that dates back to the release of Lion is Disk Maker X, formerly known as Lion Disk Maker. This is a nice wrapper for a set of Applescripts that will also create a USB drive to back up from. This was the nicest option before Apple built a utility of its own. It works much the same way as Apple's too, launch the app and follow the prompts and you end up with a USB drive you can boot from.
Keep in mind you can't install an older OS than your computer shipped with, but otherwise to use this newly minted installer all you have to do is plug in the USB drive, and hold down the Option key while the machine boots. This will give you your boot drive options, then choose the USB stick and you're all set.