Scientists have found that two recently discovered worlds are not only in the “habitable zone” of their star but are also rocky like Earth, increasing the chances that the planets have conditions that can sustain life.

The planets are relatively close to our solar system – 40 lightyears away – and orbit an extremely cool dwarf star, called Trappist-1, that appears red because most of its light is infrared, below the visible spectrum.

Scientists from MIT, the University of Liège and other schools only discovered the planets earlier this year, and had a stroke of luck to learn more about them. The two planets were caught in a rare double transit, with both passing nearly in tandem in front of their star – and the Hubble space telescope was at just the right place in its orbit to see them.

“You only have 45 minutes of continuous observation, so it just aligned perfectly,” MIT researcher Julien de Wit said. “We got super lucky.”

After discovering the planets in May, the researchers saw that a double transit was only two weeks away. They wrote a research proposal in less than 24 hours and had it reviewed and accepted.

With the telescope trained on the star system, the researchers watched closely as the starlight dipped and flickered on its way through the atmosphere of each planet. If the dips in starlight were large, they would indicate an atmosphere of light gas, with huge clouds swirling high around the planet. If the wavelength only varied slightly, it would indicate a denser, more compact atmosphere, like that of Earth.

“We should have been able to see significant variation of the amount of light blocked by the atmosphere, if the atmosphere was large and diffuse, like the ones we have around Jupiter or Neptune,” De Wit said.

“But we don’t see such large variation, meaning it’s most likely a terrestrial planet like Mercury, Venus, Mars and Earth.”

Though the planets are rocky and orbit within the so-called Goldilocks range of their star – close enough for warmth but not too close to be burnt – they likely have stark differences from Earth and its neighbors. De Wit said both planets are probably tidally locked, meaning one side always faces the sun and the other remains in shadow, like the Earth’s moon.

Though the double transit helped them rule out an atmosphere dominated by hydrogen – “We could kill two birds with one stone,” De Wit said – the researchers still have more scenarios to consider.

“There could be a water world, which is something we don’t have in our solar system,” he said, “or something with an atmosphere mainly composed of oxygen, which is something we also don’t have.”

The planets could also have an atmosphere like Venus, where carbon dioxide layers the skies; like Earth, with heavy clouds and a mix of nitrogen and oxygen; or like Mars, where the atmosphere has been stripped away by lashes of solar wind.

More precise instruments will help the researchers determine the elements and molecules that dominate the atmospheres, he said. The team hopes to continue studying the three planets in the Trappist system, but will also look at 70 stars in all, with a number of devices hunting for more planets.

The team used the Transiting Planets and PlanetesImals Small Telescope (Trappist) to perform its research on the edge of the Atacama desert in Chile, and hopes to establish a new telescope in the northern hemisphere. The Trappist telescope is designed to survey the sky in infrared, and is a prototype for a larger project, dubbed Speculoos, that will study about 500 star systems, with a focus on bright, ultracool dwarf stars.

De Wit said that the researchers hope to use the new telescopes, costing about $400,000 each or “about the price of an apartment in Cambridge”, to create a detailed list to rank the most “suitable and exciting” planets and stars. “If we have this list we can significantly increase the scientific return,” he said. They have started a fundraising campaign for the work, and published their findings Wednesday in the journal Nature.

Nasa scientists have found more than 1,200 planets outside our solar system, including more than 500 likely rocky planets. Three in particular, both discovered in the past 18 months, have raised scientists’ hopes for finding a habitable world that is in a middling range to its sun, has a rocky surface and the presence of liquid water.