A lunar mystery that has lingered for decades has finally been solved, thanks to data collected by NASA's GRAIL mission and some science detectives here on Earth.

Back in 1968, JPL scientists made an irritating discovery while preparing for the Apollo landing: Lurking beneath the lunar surface were invisible and large concentrations of mass that the scientists dubbed "mascons."

The scientists couldn't see them, but the spacecraft could feel them. The gravitational pull where there were mascons was significantly stronger than on other parts of the moon, and the difference was powerful enough to push a spacecraft in lunar orbit off course -- potentially leading to a crash.

"At first, they were a most unwelcome surprise," said Jay Melosh, a member of the GRAIL team and a professor at Purdue University. "They are a navigational hazard. With our GRAIL mission we had to fire the thrusters three times a week because of the changes to the orbit caused by these mascons."

On the near side of the moon, the mascons seemed to occur at impact craters that were filled with hardened lava, so for a long time scientists theorized that the mass of the lava was responsible for the moon's uneven gravitational pull.

But in 1996, scientists discovered mascons on the far side of the moon in craters that were not filled with lava.

This was puzzling; one would expect to find a deficit of mass in a hollow crater, not an excess.

"There was a lot of head-scratching going on that time," Melosh said.

Enter NASA's GRAIL mission, which sent twin spacecraft nicknamed Ebb and Flow to create a highly detailed map of the moon's gravity field in 2012.

"These mascons are clear as a bell now," Melosh said. "And it was seeing them in exquisite detail that allowed us to put together with some detail a model of what occurred."

The GRAIL data indicated that the mascons, which resulted from asteroid impacts more than 3 billion years ago, appear in a target pattern. There is a surplus of gravity in the bull's-eye, surrounded by a ring with a gravity deficit, which in turn is surrounded by a ring of gravity surplus.

This pattern could occur only if the interior of the moon was significantly warmer than it is now when it was pounded by the asteroids that caused the craters, Melosh said.

"The hot rock under the surface was able to rebound upward in response to the impact and got frozen in that concentration," he said. "The interior had to be warmer to allow it to flow up, and the surface had to be cool enough to allow it to freeze and hold that excess mass up."

A paper detailing the findings of Melosh and his colleagues was published in Science this week.

"Now that we understand lunar mascons, by extension we may be able to understand similar impact basins on Mars and Mercury," Melosh said.

The findings could also have implications for better understanding Earth.

"Our planet suffered similar impacts in its distant past, and understanding mascons may teach us more about the ancient Earth," Melosh said in a statement.