I saw the movie as a kid, so it was probably from the '80s. It's about two planets heading towards the Earth. The first one passes close by, causing floods, earthquakes, etc. The second one (spoiler alert) hits the Earth.
That's all I remember. Anybody knows the movie?