If you recently did a update and rebooted, sometimes when the firmware is applied it will show a loading bar, if it can't update the firmware it might keep showing it. But if you didn't recently update, then this is not the problem.
In your case then the fsck drive check that runs when you first boot OS X has found a issue with the file structure of the drive and showed a loading bar because it was attemtping to fix it and failed. If you would have left the machine turned on, it should have shut itself off eventually.
So first you have to ask yourself. Do you have two forms of backup of your personal data off the machine?
If not, then your going to have to do this first to grab what you can. You can skip it, but your taking a risk.
Create a data recovery/undelete external boot drive
The problem with only having TimeMachine as a backup is it's not bootable to verify you have access to your files, your basically taking a chance it's fine and if the corruption on the boot drive made it self over to the TM drive, it's corrupted as well.
If you have a bootable clone, then option key boot off that and check out your files are safe.
Most commonly used backup methods
If you do have a couple of copies of your data off the machine, then your ready to proceed with fixing your problem, which MAY require a comple erasure of the Macintosh HD partiton to fix if any of these fixes don't work first.
..Step by Step to fix your Mac
I can say this about your problem, it seems to be a issue with software retention on the drive and not necessarily hardware because your booting up the first portion of OS X that contains fsck, but it can't load later parts of itself for some reason.
It might be because there is a issue with the drive corrupting the data or it might be you moved the machine while it was running and it damaged sectors, or it might be that sectors failed just on their own.
If the Steps don't fix your issue, then your looking at a Zero Erase and Install, then restoring your files from the backups you have.
Erase, formatting, OS X installs on Mac's