In 1874 he wrote Spectres lumineux, spectres prismatiques, et en longeurs d'ondes destines aux recherche de chimie minerale, which was published in Paris by Gauthier-Villars and was one of the first descriptions of the new science of spectroscopy developed by Kirchhoff. In 1875 he used this method to discover the element gallium, which he named after the Latin word for France, Gallia. He found the metal in a sample of zinc ore from the Pyrenees. A year later he isolated the element by electrolysis. It was later claimed that Lecoq had named the element after himself, since gallus is the Latin translation of the French le coq, but Lecoq denied this in an article of 1877. The existence of gallium had been predicted in 1871 by Mendeleyev, who called it eka-aluminium, and its discovery was a boost for Mendeleyev's theory of the Periodic Table. Later Lecoq discovered samarium (1880) and dysprosium (1886).
He died in Paris at the age of 74.