If you have a recent Mac then it has a recovery partition. Boot your Mac and hold down <kbd>Command-R</kbd> until the Apple logo appears.

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

[This tech note](http://support.apple.com/kb/ht4718) from Apple 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.