If you have a recent Mac then it has a [recovery partition][1].

Power on your Mac and hold down <kbd>Command</kbd>+<kbd>R</kbd> until the Apple logo appears. This will cause your Mac to boot using the recovery partition.

Once you are in the recovery partition, you can then reinstall the operating system.

This Apple technical note, [OS X: About OS X Recovery](http://support.apple.com/kb/ht4718), gives more details.

You can reinstall the OS and leave your files intact. Just make sure you don't reformat the drive and the OS will go on top of your old files.


  [1]: http://www.apple.com/osx/recovery/