The planet will collide with Earth and wipe out all of humanity

Edwin Balmer : science fiction author
Philip Wylie : science fiction author
A South African astronomer will discover that a pair of rogue planets, Bronson Alpha and Bronson Beta, soon enter the solar system. The larger one, Alpha, will pass close enough to cause catastrophic damage. Eight months later, after swinging around the Sun, Alpha will return to pulverize the Earth and leave. It is believed that Bronson Beta will remain and assume a stable orbit.
Scientists will work desperately to build ships to transport enough people, animals and equipment to Bronson Beta in an attempt to save the human race. Governments are skeptical, but the scientists persist and develop the technology necessary for the spacecraft, which are built in various countries. Nations including the United States evacuate their coastal regions in preparation for the Bronson bodies' first pass.

Novel "When Worlds Collide"