First, try this.
REPAIRING DISK - About OS X Recovery - http://support.apple.com/kb/HT4718.
- restart your computer hold down command + R keys on the keyboard to boot you into Lion / Mountain Lion Recovery mode
- select english as your main language then the continue arrow
- select "Disk Utility" on the resulting screen then 'Disk Utility' ---
- When prompted to select a disk volume or image, select the 'Macintosh HD' in the left column
- ensure the the "first aid" tab is highlighted blue in the middle of the screen
- click the button at the bottom that says 'REPAIR DISK' .......NOT "Repair disk permissions"
- this process will take a few minutes to run. It will indicate it's done, by scrolling to the bottom of the "details area" displaying "The Macintosh HD appears OK"
If you get any other message OTHER than "The Macintosh HD appears OK", like "the Macintosh HD was repaired successfully" run the "Disk Repair" again, until it displays "The Macintosh HD appears OK".
Once done, restart the computer as normal
If you still have the issue, try Running the Apple Hardware Test can help rule out Hardware issues. If they are intermittent, running the Hardware test in "Loop mode" overnight, can be very helpful.
10.8 - Apple Hardware Test - http://support.apple.com/kb/PH11342.
Restart your computer, holding down the D key while the computer restarts.
After your computer restarts, you should see the Apple Hardware Test chooser screen. If you don’t, Apple Hardware Test may not be available on your computer. You may be able to start Apple Hardware Test from the Internet. Reconnect your computer to the network, and then restart your computer while holding down both the Option and D keys.
Many times, running the "quick" test, or the "extended" test, may not give you any error results. Many intermittent issues, may need to have the hardware test to run in loop mode, before it detects any error, and therefore running the Apple Hardware Test in Loop Mode overnight is an excellent troubleshooting step for finding intermittent hardware problems.
In continuous Loop Mode, the test will run continuously until a problem is found or is stopped by you, by clicking “Stop Test” or by using the Command-period keyboard shortcut. If a problem is found, the test will cease to loop, indicating the problem it found. If the test fails, be sure to write down the exact message associated with the failure. Looping mode could be helpful in diagnosing a fault that may be heat related or when the fault occurs randomly.-------
-- The Apple Hardware Test console appears. You can choose what sort of test or tests to perform: basic or select the "Perform extended testing"
-- press and hold down the option key and the "L" key...then select the extended test. This will make the test go into Loop mode
-- look over the test results and make notes of any errors that may be logged
-- to exit out of the test, press the escape key