Move as little as possible - most injuries during earthquakes occur because of people moving around, falling and suffering sprains, fractures and head injuries.
Try to protect your head and torso.
If you are in bed, stay there, curl up and hold on, and cover your head.
Stay indoors until the shaking stops and you are sure it is safe to exit.
If you must leave a building after the shaking stops, use stairs rather than an elevator in case of aftershocks, power outages or other damage.
Be aware that smoke alarms and sprinkler systems frequently go off in buildings during an earthquake, even if there is no fire.
If you smell gas, get out of the house and move as far away as possible.
Before you leave any building check to make sure that there is no debris from the building that could fall on you.