How the Sun stole Mars' atmosphere