Fluorescence of corals commonly found in the deep reefs of the Red Sea were discovered by researchers. (Photo courtesy of J. Wiedenmann)

If you ever manage to get yourself to the bottom of the Red Sea in the middle of night, you might think you were transported into James Cameron's "Avatar."

Here, corals glow in a rainbow of fluorescent colors, something a team of researchers recently discovered while diving more than 160 feet deep in the sea.

At these depths, the flashy critters like to show off their fluorescent pigments, which are actually proteins. When illuminated with blue or violet light, the pigments reflect colors with longer wavelengths — turning them into bright reds, oranges and greens.

[Check out this creepy little guy: A vampire squid that's not a vampire or a squid]

In shallower parts of the sea, corals have been known to do this for a while, but only when assisted with blue or violet flashlights. Joerg Wiedenmann, one of the researchers on the team from the University of Southampton, said there had been hints of more fluorescence farther down, but it was only recently that anyone had diving equipment advanced enough to check it out first hand.

Corals from shallow water of the Red Sea are mostly green fluorescent like this Platygyra coral. (Photo courtesy of J. Wiedenmann)

The fact that reefs in deeper levels not only have the same fluorescent properties as those above, but at even higher concentrations, is surprising. Scientists have theorized that these pigments are used like a natural sunscreen for organisms in the shallow areas, but very little sunlight ever gets down to the deep parts of the Red Sea.

The fluorescence of this Lobophyllia coral can change from green to red when exposed to violet light. (Photo courtesy of J. Wiedenmann)

So the question remains: Why? What's the evolutionary advantage to having these pigments? Or do these corals just enjoy the occasional glow-in-the-dark rave?

[These deep sea ‘mushrooms’ don’t fit into any known category of life]

Scientists will continue to grapple with this mystery. In the meantime, Wiedenmann's team suggested this week in the research journal PLOS ONE that the pigments could have practical applications in medicine. The fluorescent glow can be used to highlight living cells or cell structures under a microscope, so they could be useful in tracking cancer cells or screening for new drugs.

"This discovery shows how little we know about coral reefs — and that we can get useful materials out of them," Wiedenmann said. "So it's important we take care of them."

Read More:

The cutest octopus ever may end up with the name ‘adorabilis’

It’s little crabs vs. big sea stars in the Pacific. Winner gets the coral.

Ghostly new fish discovered at record-breaking depths