Collision Earth

When the sun converts to a magnetar for a short time, the planet Mercury is thrown out of orbit (along with a spaceship exploring it) and set on a collision course for Earth. Can a disgraced scientist manage to use his failed weapon system, Project 7, to save our planet?