If you've ever tried to ripen a piece of fruit by sticking it in a bag with a banana, you've harnessed the power of ethylene.Ethylene is an important plant hormone. In bananas and many other fruits, production of ethylene surges when the fruit is ready to ripen. This surge triggers the transformation of a hard, green, dull fruit into a tender, gaudy, sweet thing that's ready-to-eat.Scientists have studied ethylene's role in plant physiology for more than a century and the produce industry has long used the gas to manipulate ripening. But how fruits regulate production of the hormone has been a mystery. Now scientists have found a master switch that leads the plant to crank up ethylene production when the time is, well, ripe.In a study published Monday in Nature Plants, researchers found that before a fruit is ready to ripen, this master switch prevents ripening-related genes from being turned on before it's time.Flipping the master switch "is like breaking the glass on a fire alarm," says study coauthor James Giovannoni, a plant molecular biologist at the U.S. Department of Agriculture and Cornell University. "Once you pull that lever, things really start happening."The switch is critical because ripening too early can have dire consequences for the plant — it might miss its chance to procreate. Making fleshy, delicious fruits is a strategy: the end game is getting an animal to eat the fruit and disperse the seeds within.When the ripening switch is triggered, genes are activated. This ultimately makes the fruit ready-to-eat: the plant dials up sugar production in the fruit and starts making sweet-smelling compounds to tempt an animal's nose and pigments that catch an animal's eye.In some fruits, flipping the ripening switch also leads to activation of machinery for making ethylene. Ripening fruit doesn't happen in a moment, it happens over time. Once the fruit starts synthesizing ethylene, the hormone keeps everything that needs to be turned on, turned on, sustaining the ripening process.This explains why the banana-in-the-bag trick works and why sometimes it doesn't. If a fruit is exposed to ethylene well before its ripe, it won't do much. In fact, in some fruits it can stymie ripening. But in certain fruits, exposure to the gas in the critical window will propel ripening along. We now know that for fruits like apples, bananas, peaches, mangoes, pears and tomatoes, this window opens when the master switch is flipped. For fruits that ignore ethylene, like grapes, pineapples and many berries, the bag trick won't work.Controlling when and where ethylene is turned on is a delicate balancing act for the plant. Ethylene isn't only involved with ripening, it is also a stress hormone. When a plant part like a leaf is attacked or damaged, ethylene kicks off the process of decay, causing damaged parts to wither and amputate.It make intuitive sense that ethylene is involved in both ripening and decay, says Harry Klee, an expert in the genetics and biochemistry of fruit at the University of Florida in Gainesville, who was not involved with the study."Fruit ripening is the start of decay," says Klee. "We happen to pick it and eat it at one stage, but it is on its way to being a bag of mush."Humans have harnessed ethylene's ripening powers for centuries. Ancient Egyptians sliced into figs, triggering ethylene's release and enhancing the ripening process. Chinese farmers ripened pears by burning incense in the pear storage rooms. The saying "one bad apple spoils the lot" refers to how ethylene released by a decaying apple will prompt nearby apples to ripen and eventually decay as well.A critical observation of ethylene's stress-related activity came in the late 1800s, when scientists noticed that gas emitted from street lamps prompted nearby trees to wither and drop their leaves.Today, produce distributors regularly manipulate ripening in fruits that respond to ethylene. Bananas, tomatoes, peaches, pears and some other fruits are often picked when they're almost ripe. These fruits are shipped while still firm and less likely to damage. Then, distributors release ethylene into the warehouse storing the fruit, ripening them further before delivery to market. (This can sometimes be disastrous, ethylene is flammable and explosions in fruit warehouses have killed people).The discovery of the ripening switch could allow for even finer regulation of the process, says Klee. And the data generated in the new study could help researchers investigate a slew of other ripening-related issues, including flavor.A few years ago Klee and his colleagues discovered why tomatoes lose their flavor after being stuck in the fridge: The chilling changes the activity of important flavor-related genes. The new study suggests that a similar ripening switch may be the culprit for flavorless fruit.The research could also help breeders understand ripening in fruits that are less-studied than tomatoes or bananas. Because the scientists were able to pinpoint the genes that are activated by the ripening switch, breeders can now look for different versions of those genes in wild populations of fruits. This could lead to the discovery of new varieties that take a longer or shorter time to ripen — the sorts of discoveries that bring us fruits even when they are out-of-season.Detecting when the ripening switch is ready to be thrown gives produce growers a clearer shot at the perfect ripening window. And if they can apply it to a range of fruits, that could mean even more variety for us in the supermarket aisles.Rachel Ehrenberg is a freelance journalist based in Boston. She writes about the intersection of science, food, people and policy. Follow her on Twitter. Copyright 2018 NPR. To see more, visit http://www.npr.org/.