If you want to preserve the data on the startup drive, and it's not already backed up, you must try to back up now, before you do anything else. It may or may not be possible. If you don't care about the data, you can skip this step.
There are several ways to back up a Mac that is not fully functional. You need an external hard drive or other storage device to hold the data.
1. Start up from the Recovery partition, from Internet Recovery, or from a local Time Machine backup volume (option key at startup.) Launch Disk Utility and follow the instructions in this support article, under “Instructions for backing up to an external hard disk via Disk Utility.” The article refers to starting up from a DVD, but the procedure in Recovery mode is the same. You don't need a DVD if you're running OS X 10.7 or later.
2. If Method 1 fails because of disk errors, then you may be able to salvage some of your files by copying them in the Finder. If you already have an external drive with OS X installed, start up from it. Otherwise, if you have Internet access, follow the instructions on this page to prepare the external drive and install OS X on it. You'll use the Recovery installer, rather than downloading it from the App Store.
3. If you have access to a working Mac, and both it and the non-working Mac have FireWire or Thunderbolt ports, start the non-working Mac in target disk mode. Use the working Mac to copy the data to another drive. This technique won't work with USB, Ethernet, Wi-Fi, or Bluetooth.
4. If the internal drive of the non-working Mac is user-replaceable, remove it and mount it in an external enclosure or drive dock. Use another Mac to copy the data.