The most common reference for rules regarding what type of lightning fixture can be used in a bathroom is the National Electrical Code book published by the National Fire Protection Association. The 2014 copy is the latest edition and defines three types of conditions: dry, damp and wet. Lighting fixtures must indicate the correct design for the location where they will be installed.
The appropriate rating for fixtures will normally be on a sticker attached to the fixture's housing. Fixtures marked "Suitable for Dry Locations Only" are to be installed indoors in a dry area. Fixtures marked "Suitable for Damp Locations" can be used in damp or dry locations and when marked "Suitable for Wet Locations" the fixture can be installed in any of the three locations: dry, damp or wet. It is important to purchase a fixture consistent with where you plan to install it to avoid building code violations.
Damp or Wet Area Boundary
The defined areas of the bathroom are based on the rim of the tub or the shower stall threshold. The rule states "no cord-connected, hanging, pendant, lighting track or suspended ceiling paddle fan lighting fixture shall be located in an area within 8 feet vertically and 3 feet horizontally from the tub rim or shower stall threshold." Measure 3 feet away from the tub rim horizontally and 8 feet up from that point. This defines the boundary surrounding the tub. The code also states "this space is all encompassing and includes the space directly over the tub or shower stall." Fixtures installed within this tub or shower area should be marked "Suitable for Damp Locations" unless exposed to shower spray in which case they must be marked "Suitable for Wet Locations."
When installing a light make sure that at least one wall switch-controlled light is installed in your bathroom to meet NEC code requirements. The receptacle in the bathroom will be protected by a ground fault circuit interrupt, or GFCI. The GFCI may be built in the receptacle, or the branch circuit for the entire bathroom may be protected by a GFCI circuit breaker in your breaker box. Make sure you know where the GFCI is located, whether it protects your lightning fixture in addition to the receptacle and if your local code requires it.
Local Code Considerations
The National Electrical Code book sets the rules most commonly used for electrical installation codes but it gives some interpretation latitude to your state or municipality. Cities, states and counties may also have some additional rules enforced based on local experience and opinion. It is always wise to check with this source when in doubt. Most reputable hardware stores understand the NEC code, as well as local codes, and are also a great source of information and advice.