Why bacteria produce light?
Go for the  link below, you will find an article on "How do marine bacteria produce light, why are they luminescent, and can we employ bacterial bioluminescence in aquatic biotechnology?"

www.biology-online.org/articles/marine_bacteria_produce_light/abstract.html

From this article :


  The question remains whether quorum sensing regulation of bacterial
  luminescence is a kind of a ‘social behaviour’ in which cells
  ‘predict’ the possibility of increased mutagenesis where conditions
  allow for efficient metabolism leading to extensive bacterial growth.
  Such conditions may cause the appearance of large quantities of
  metabolites, including mutagenic agents. Thus, one could speculate
  that enhanced light emission at a high cell density may ensure more
  efficient DNA repair in response to potentially increased
  concentrations of mutagens. Alternatively, quorum sensing may be
  needed for another role of bacterial bioluminescence, besides
  stimulation of photoreactivation.