Yes, it is okay to use 12-2 cable to supply lighting fixtures. The other answer indicates that it even with 12-2 you have to use a 15A breaker for lighting circuits which is not strictly correct.
If the entire circuit is 12AWG (other than fixture wires), then a 20A breaker may be used.
If only part of the circuit is 12AWG while other parts are 14AWG (other than fixture wires), then a 15A breaker must be used because of the allowable ampacity through 14AWG. In general, I would recommend avoiding mixing 14AWG and 12AWG on the same circuit to avoid confusion. If necessary, I would highly recommend labeling the circuit at the breaker with a note explaining the combination of 12AWG and 14AWG wire on the circuit. I think this is the situation Niall C's answer was explaining.
Fixture wires in either case must comply with the requirements listed in 240.5. Note: This is why many lighting fixtures (e.g. ceiling fans, dome lights) and light switches with built-in wires (e.g. combination switch/occupancy sensor, combination switch/timer) have wires smaller than 14AWG.
From the 2014 NEC (NFPA-70):
Note: In the 2011 edition, the text of 210.22 and 210.23 were in a single clause, but essentially said the same thing. These requirements are not new in the 2014 standard.
210.22 Permissible Loads, Individual Branch Circuits. An individual branch circuit shall be permitted to supply any load for which it is rated, but in no case shall the load exceed the branch-circuit ampere rating.
210.23 Permissible Loads, Multiple-Outlet Branch Circuits. In no case shall the load exceed the branch-circuit ampere rating. A branch
circuit supplying two or more outlets or receptacles shall supply only
the loads specified according to its size as specified in 210.23(A)
through (D) and as summarized in 210.24 and Table 210.24.
(A) 15- and 20-Ampere Branch Circuits. A 15- or 20-ampere branch circuit shall be
permitted to supply lighting units or other utilization equipment, or
a combination of both, and shall comply with 210.23(A)(1) and (A)(2).
Exception: The small-appliance branch circuits, laundry branch
circuits, and bathroom branch circuits required in a dwelling unit(s)
by 210.11(C)(1), (C)(2), and (C)(3) shall supply only the receptacle
outlets specified in that section.
Equipment Not Fastened in Place. The rating of any one
cord-and-plug-connected utilization equipment not fastened in place
shall not exceed 80 percent of the branch-circuit ampere rating.
(2) Utilization Equipment Fastened in Place. The total rating of
utilization equipment fastened in place, other than luminaires, shall
not exceed 50 percent of the branch-circuit ampere rating where
lighting units, cord-and-plugconnected utilization equipment not
fastened in place, or both, are also supplied.
240.5 Protection of Flexible Cords, Flexible Cables, and Fixture Wires. Flexible cord and flexible cable, including tinsel cord and extension cords, and fixture wires shall be protected against overcurrent by either 240.5(A) or (B).
(A) Ampacities. Flexible cord and flexible cable shall be protected by an overcurrent device in accordance with their ampacity as specified in Table 400.5(A)(1) and Table 400.5(A)(2). Fixture wire shall be protected against overcurrent in accordance with its ampacity as specified in Table 402.5. Supplementary overcurrent protection, as covered in 240.10, shall be permitted to be an acceptable means for providing this protection.
(B) Branch-Circuit Overcurrent Device. Flexible cord shall be protected, where supplied by a branch circuit, in
accordance with one of the methods described in 240.5(B)(1), (B)(3), or (B)(4). Fixture wire shall be protected,
where supplied by a branch circuit, in accordance with 240.5(B)(2).
(1) Supply Cord of Listed Appliance or Luminaire. Where flexible cord or tinsel cord is approved for and used with a specific listed appliance or luminaire, it shall be considered to be protected when applied within the appliance or luminaire listing requirements. For the purposes of this section, a luminaire may be either portable or permanent.
(2) Fixture Wire. Fixture wire shall be permitted to be tapped to the branch-circuit conductor of a branch circuit in
accordance with the following:
(1) 20-ampere circuits — 18 AWG, up to 15 m (50 ft) of run length
(2) 20-ampere circuits — 16 AWG, up to 30 m (100 ft) of run length
(3) 20-ampere circuits — 14 AWG and larger
(4) 30-ampere circuits — 14 AWG and larger
(5) 40-ampere circuits — 12 AWG and larger
(6) 50-ampere circuits — 12 AWG and larger