This is 'Spin' by Robert Charles Wilson written in 2005, first book of the "Spin Saga"
One night in October when he was ten years old, Tyler Dupree stood in his back yard and watched the stars go out. They all flared into brilliance at once, then disappeared, replaced by a flat, empty black barrier. He and his best friends, Jason and Diane Lawton, had seen what became known as the Big Blackout. It would shape their lives.
Life on Earth is about to get much, much stranger.
An opaque black "spin membrane" has been placed around Earth. The membrane has slowed time so that approximately 3.17 years pass outside the membrane for every second within, or 100 million years on the outside for every year within. The membrane is permeable to spacecraft, and it protects Earth from the harmful effects of concentrated stellar radiation and cometary impact. A simulated sun on the inside of the membrane allows for a largely normal life cycle to continue. However, the passage of time outside the membrane means that all life on earth will end in a few decades when the sun's expansion makes that region of the solar system uninhabitable.
The Martian connection is carried out by a science and aerospace consortium named Perihelion
Perihelion terraforms Mars, a process that is finished in a few months of subjective Earth time. When the terraforming is complete, Perihelion and its counterparts in other nations launch manned colonization missions. Two years after the terraforming process begins, Earth receives satellite images confirming the existence of agriculture and sophisticated human civilizations on Mars. Soon afterward, Mars is enclosed in its own Spin membrane.
Two further books of this Trilogy - Axis & Vortex.