As the world's oceans continue to warm, coral reefs are struggling to survive. In recent years large swaths of some of the world's biggest and best known reefs have died, and a recent UN report maintains that the reefs could "cease to exist as functioning coral reef ecosystems by the end of this century" unless steps are taking to protect them.

But scientists are stepping in to help. From floating chemical "sunscreens" to reef-patrolling robots, they're developing all sorts of strategies and devices to help coral. In one of the most promising approaches, researchers are looking for ways to accelerate the pace at which corals adapt to warmer seas — so they can survive rather than succumb.

It’s too soon to know whether this approach will work. But recent research shows that coral that has survived one especially warm period has a better chance of surviving another one.

Harnessing genes

Manuel Aranda, a marine scientist at King Abdullah University of Science and Technology in Thuwal, Saudi Arabia and the author of two studies published in June and August in the journal Science Advances, thinks the first warming event activates genes that prime the coral to cope with the next round of heat stress.

He says it’s a bit like how people who take time off from exercising after getting into shape are quickly able to get back in shape once they start working out again.

If Aranda is right — and if this optimal gene function can be passed from one generation of coral to the next — it might be possible to set up coral nurseries where corals are preconditioned to survive heat before being transplanted into the wild. “Maybe we could give them a little head start, so that when the heat wave comes, they can respond faster and better than a coral that has not been trained,” he says.

Why coral reefs count

Coral reefs play a vital role in the global ecosystem and economy. Though they cover a tiny fraction of the sea floor, they’re home to 25 percent of all marine plants and animals, according to the National Oceanic and Atmospheric Administration.

In addition to helping protect vital fisheries, reefs help safeguard nearby coastal areas from dangerous wave action and are a major attraction for tourists. Globally, they produce $9.9 trillion per year in economic benefits, says James Porter, an emeritus professor of ecology at the University of Georgia and a noted expert on diseases of coral.

But the world’s coral reefs need help — and fast. In 2014 and 2015, above-average temperatures in the Pacific Ocean devastated reefs in the Hawaiian Islands. The following year, two-thirds of Australia’s Great Barrier Reef underwent bleaching, in which coral expel the symbiotic algae that live in their tissue. The coral can survive bleaching, but the stress makes it more vulnerable and likely to die. This year, there are warning signs coming from the Caribbean and Bermuda, according to Hollie Putnam, a coral expert at the University of Rhode Island.

“We’re in a triage situation,” Porter says. “We need to do everything and we need to do it all at once.”

A complex ecosystem

Warmer, more acidic water hampers the ability of coral to build its calcium carbonate skeleton and leaves reefs vulnerable to attack by marine microbes that thrive in warm water. Any effective effort to precondition coral must take into account the effects not only on the coral itself but also on the bacteria, viruses, algae, and other organisms that coral interacts with in in the marine environment.

“We know not only one thing is changing,” Putnam says. But “we really don’t have a very clear understanding of what that ‘cross-talk’ is doing and who is leader and who is the follower.”

In Australia, a team of scientists is rearing fast-growing corals to see if preconditioning can help them withstand a 1- to 2-degree Celsius temperature increase — and whether this hardiness can be passed down to future generations.

A coral recovery specialist with the state of Hawaii holds a piece of coral he and a team of scientists have been growing at the Anuenue Fisheries Research Center's coral nursery in Honolulu. Caleb Jones / AP file

Neal Cantin, a research scientist at the Australian Institute of Marine Science and the team’s leader, says the researchers spent the last year tracking 7,500 first-generation preconditioned corals. The corals will become reproductively mature within the next six months, and it’ll take two more years for the second generation to fully mature and produce larvae that can be tested for temperature hardiness.

“We should know in the next couple of years whether it’s enhancing tolerance for restoration,” Cantin says.

In the meantime, following a more conventional path, coral nurseries are producing typical corals and then transplanting them into reefs. That won’t be enough to solve the problem of warming seas, Cantin says. But, it might bridge the gap until scientists learn how to better help corals help themselves.

Want more stories about the environment?

FOLLOW NBC NEWS MACH ON TWITTER, FACEBOOK, AND INSTAGRAM.