German national rail operator Deutsche Bahn is outfitting its rails with invisible codes to try to thwart theft from black-market dealers cashing in on high commodities prices, a spokesman said.

The number of thefts of Deutsche Bahn rails and equipment has roughly doubled since 2009, costing the company some 10 million euros ($14.2 million) per year and causing delays or even cancellations of thousands of trains, the company said.

"The codes are meant are to help police identify stolen equipment and also to deter people from stealing them," a Deutsche Bahn spokesman said.

The codes are invisible on the metal and are only seen under special light and show the location where it was stolen. But the codes are of little use if thieves melt the stolen goods.

"They're like an individual fingerprint," he said.

Most popular among thieves are equipment containing copper, such as cables and contact wires. Deutsche Bahn and police caught some 500 people stealing rail equipment last year. (Reuters)