A visible-light-active nitrogen-doped mesoporous TiO2 (N-TiO2) film was synthesized via sol-gel spin-coating technique, using carbon spheres as pore-forming materials. The as-prepared film was characterized by XRD, BET, SEM, XPS and UV-Vis. The N-TiO2 film showed higher photocatalytic activity in the degradation of dye Reactive Brilliant Red X-3B (C.I. reactive red 2) under visible light irradiation compared with smooth TiO2 film and P25 film. The apparent rate constant of the N-TiO2 film was almost 10 times as that of P25 film.