A genetic breakthrough raises hope of easing suffering for people with chronic lung disease - and maybe those just fighting a common cold.
The biological reason why the lungs of people with conditions such as asthma and cystic fibrosis often clog up with thick mucus has been unclear.
But Cincinnati Children's Hospital researchers have identified the main genetic switch behind the build-up.
The Journal of Clinical Investigation study raises hopes of new treatments.
Lead researcher Dr Jeffrey Whitsett said a way to combat excessive mucus production would potentially be a significant step forward, as there was currently no effective treatment to remove build-up once it had taken place.
It was thought that after airways were attacked by an allergic response or inflammation mucus cells, known as goblet cells, divided and proliferated at a very fast rate - a process known as hyperplasia.
But instead the Cincinnati team discovered that a type of lung cell, called Clara cells, instead morph into goblet cells - a process called metaplasia.
They also showed that the process was reversible - goblet cells can change back to Clara cells if the initial problem is dealt with.
In work on mice, the researchers also identified a gene called SPDEF as key to the process of mucus production.
They used a protein from egg whites to induce an allergic reaction in inflammation in the animals' lungs, and showed that SPDEF activity soared in the affected tissues, leading to hyper-production of mucus.
However, when the gene was switched off inflammation and excessive mucus production did not occur.
And mice lacking SPDEF were unable to increase mucus production or develop goblet cells.
Further analysis showed that SPDEF plays a complex role switching other genes involved in inflammation and mucus production on and off.
The researchers hope it will be possible to develop treatments that influence activity of the gene, but warn tests in humans are still several years away.
Dr Keith Prowse, spokesperson for the British Lung Foundation, said: "Excess mucus production blights the lives of millions of patients with chronic lung conditions such as cystic fibrosis and chronic obstructive pulmonary disease.
"At present there are only a few treatments available and they are often not very effective.
"The finding that SPDEF which controls mucus production could lead to new and effective treatments which would benefit the millions of people with chronic lung disease in the UK."
Dr David Halpin is a spokesman for the British Thoracic Society and a consultant respiratory physician at the Royal Devon and Exeter Hospital.
He said: "Sputum production is a symptom of respiratory disease which is poorly treated by current medicine.
"Any advance in the understanding of the mechanisms responsible for this is likely to be a benefit to patients."