It's in the Sermon of the Seven Suns, Anguttara Nikâya 7.62 in the Pali Canon. Here are some translations of it:
Buddhist Sutra - The Sermon Of The Seven Suns
The Sermon of the Seven Suns (Anguttara VII. 62)
The_Numerical_Discourses_of_the_Buddha,Anguttara_Nikaya,Bodhi,2012.pdf
(note: 1 yojana / league is 12 - 15 km / 7 - 9 mi)
This is what it says will happen:
- A long drought: all the land plants will die.
- A second sun: the streams and ponds will dry up.
- A third sun: the great rivers will dry up.
- A fourth sun: the lakes will dry up.
- A fifth sun: the oceans will dry up.
- A sixth sun: the Earth becomes very volcanically active and fiery.
- A seventh sun: the Earth melts and boils off.
We can interpret the extra suns allegorically and suppose that those extra suns are our Sun getting brighter and brighter. Which is indeed what the Sun is doing (
The Once & Future Sun,
Future of Earth). As it does so, over the next few billion years, life will gradually be driven into extinction: first multicellular organisms, then one-celled eukaryotes, and finally prokaryotes, with hyperthermophiles being the last holdouts. The oceans will become hot enough to boil, and the Earth will become much like Venus.
When the Sun becomes a red giant, some 7 billion years from now, it will expand out to the Earth's orbit, and the Earth may not survive.
So should we convert to Buddhism because of this?
In ancient times, when the solar system was getting in order, those civilizations witnessed planets passing close to earth, several changes caused people to take those celestial bodies as gods and made human sacrifices to calm "their fury".
In many old writings, it is mentioned the appearance of "another sun in the sky", this is to say, it was seen at day time and at night time if that was the case. They didn't call it a "star" because its brilliant light and size was well over the stars. They do call "stars" to meteorites, like "falling stars".
Probably a planet reflecting the sun light and being strong shinning fwas considered "another sun" by ancient men.
What the Buddhist story is telling you is that other bodies similar to the sun will appear and will cause disastrous effects on earth, same as they did in the past.
For you to have an idea of how close were the planets to earth in the past, check on Mercury, Jupiter, Saturn, Venus, Mars.
Looking at them with your naked eye those are just brilliant small points in the sky similar to far away stars. There is no reason to consider them "gods", no reason to built temples and altars in order to worship those planets as gods... unless those planets were so close that caused straggles on earth, people were afraid and consider them gods, as immense superior powers capable to destroy life on earth, causing earthquakes, and more.
Those stories were passed generation thru generation, until the Buddhist just "predicted" a future when those "suns" will cause the same problems they caused in the past.
When you read Legends of the Jews, there is a part where it says that Moses saw planets Venus and Mars of the same size of planet earth. Definitively the causes of those "plagues" of Egypt happened all around the world. Many legends refer the same catastrophes in several places of the world. The bible itself has a psalm where it says that mountains of the world shaking, the Jordan river retreated, and more. It was a worldwide event. The manna of the Israelite was called Ambrosia by the Greeks, who considered that food coming from the sky as "food of the gods". Probably Venus or Mars caused those famous plagues of Egypt.
And please, before you argue against the narrations of those ancient people in reference of planets close to earth in those eras, I will tell you that no calculation from any scientific source can state with certainty that our solar system has been the same for millions of years. Not a single evidence is found contradicting those narrations saying that the solar system was different in those years. The mention of the planets is found in ancient writings, their close encounter with earth is also mentioned.
Only current science affirms that our solar system has not change thru millions of years based on "theories" not so in facts.
We don't have any technology to prove that our solar system has been the same for millions of years. We only have calculations in paper and lots of computer simulations, but those are not "evidence".
Seven suns might mean seven different celestial bodies.