Depending on the OS that is installed on the computer, you can deal with this problem differently. If you have installed an OS like 10.7 (Lion) or newer, you can press the Command + R button combination while the computer is restarting to enter the Recovery menu. From there you can try to restore the OS to a backed up point, to reinstall the OS or to use Disk utilities.
If you have an older OS, you will need the installer disk in order to fix your computer. For a tutorial regarding this, use Google.