Installing grounded light fixture on box with no ground conductor
There's a few options.
No grounding conductor
If there's no grounding conductor at all, there's a few things you can do.
Install a grounding conductor
Obviously, you could install a grounding conductor for the circuit.
Share a grounding conductor
Code allows you to share a grounding conductor from another circuit, as long as the grounding conductor is properly sized.
GFCI protected
If you're replacing a fixture, you don't need a ground if the outlet is GFCI protected.

National Electrical Code 2014
Chapter 4 Equipment for General Use
Article 410 Luminaires, Lampholders, and Lamps
410.44 Methods of Grounding. Luminaires and equipment shall be mechanically connected to an equipment grounding conductor as specified in 250.118 and sized in accordance with 250.122.
Exception No. 3: Where no equipment grounding conductor exists at the outlet, replacement luminaires that are GFCI protected shall not be required to be connected to an equipment grounding conductor.

Grounding via conduit or cable covering or ground in box
At times, metallic boxes are grounded using metallic conduit, or the outer covering and/or internal bonding strip of armored cable. If this is the case, then the box may actually be grounded.
There's also a chance that there's a grounding conductor stuffed in the back of the box.
Extend the grounding conductor
If the box is grounded, you can simply connect a grounding conductor to the box. If  there's a grounding conductor stuffed in the box, you can simply connect to it.