Update: As several of our commenters pointed out, the OS is probably running the fsck utility in the background to repair directory problems, while showing the progress bar to the end user so they know there's something going on (fsck can take quite a while). Here's an older Apple support article that explains the disk repair process very well. We will update you if we find a support article with more information.
Here's a story for anyone who's come across an unusual progress bar during boot and my best guess at what it really is. The moral of my story: backup frequently and try not to turn off your Mac while it is starting up.
Five days ago, I was prepping my late 2008 MacBook Pro for resale when I encountered the ever-spinning gear at boot. Ridiculously enough, I hadn't kept up any of my backups in a month and I hard powered off the machine while it was booting because I forgot to select the boot drive (yes -- I'm a technician and I did something dumb -- I know). Many thoughts went through my head: I've lost the last month's worth of work, I have to waste hours trying to recover data from my drive, why did this have to happen while I was trying to back it up? It goes to show that it can happen to anyone at any time and that the only real solution is to keep a current backup (if not several) of all your information.
Now for a quick word on backups. I usually keep a continuous Time Machine backup of everything and clone my internal drive every couple weeks. The cloned drive is kept in a fireproof safe here in my house. Also, as much as I love Time Machine, in my profession, I've seen several instances where Time Machine backups don't restore properly. I always suggest having a manual clone as a backup to your backup.