- J.C., Wells
We'll take each question in turn: So is the moon being attracted by another planet and eventually it will move into another planets orbit?
The moon is in orbit around Earth and is gravitationally bound to it. This bond was established on its formation and will never be severed. Our moon will remain a satellite of Earth for the rest of its history. That having been said, it is worth mentioning that the moon will not remain at the same distance. It recedes from Earth at about 3.8 cm (1.5 inches) a year and as a consequence, Earth's rotational speed diminishes. Eventually, the moon and Earth will establish a state of mutual synchronous rotation, in which the length of both Earth's and the moon's rotations will equal the moon's orbital period. Of course, if you do the math (or, in my case, let a smart person do the math and then copy the answer), you find out that this mutual synchronous rotation won't happen for about five trillion years: a period of time far surpassing the current age of the Universe. Presently, the moon has a synchronous rotation, meaning that its orbital period is equal to its spin rate. For this reason, we never see the "far side of the moon."* So, in short, the moon will move away from Earth gradually, but we'll never lose it entirely.
Is Earth also moving closer towards the sun? Will all the planets eventually be pulled into the sun and have a flaming end?
As these last two questions are related, we decided to combine them. The planets have well established orbits at different distances from the Sun.* Their distances do vary throughout each cycle because their orbits are elliptical. However, their mean distances will remain more or less the same, except for the minor shifts resulting from the gravitational influences of other planets.
Planets are actually moving in straight lines, or, at least, they would if no force were exerted onto them. The Sun acts as the solar system's centralized force. Its gravity "bends" each planet's straight-line motion into an elliptical trajectory. The planets maintain an orbital speed necessary to remain at a constant distance from the Sun, while the Sun's gravity prevents the planets from escaping.
Satellites in orbit around Earth can experience decaying orbits as a result of atmospheric drag. Though the atmosphere is comparatively tenuous at satellite orbital altitudes,** they are sufficient to induce a retardation effect. For instance, the International Space Station, with an altitude of about 400 kilometers (249 miles) has to periodically compensate for this drag to prevent an inexorable descent toward Earth. Planets do not experience such frictional effects in outer space and therefore will not fall into the Sun.
However, some planets will, indeed, meet a flaming end: specifically, Mercury, Venus and Earth. When the Sun exhausts its core hydrogen reserves in approximately five billion years, its outer layers will expand and it will become a red giant. These layers will consume and incinerate the inner planets, Mercury, Venus and Earth. (The issue of whether or not Mars shall experience the same fate remains unresolved.) Therefore, our planet will be consumed in the solar flames, but only because the flames will travel to Earth.
*Just for "fun," we've listed the mean planet distances in term of Astronomical Units, or AU. (An "astronomical unit" is defined as Earth's average distance, which is, as a rough approximation, 93 million miles.)
Mercury 0.387 AU
Venus 0.723 AU
Earth 1.000 AU
Mars 1.523 AU
Jupiter 5.203 AU
Saturn 9.585 AU
Uranus 19.154 AU
Neptune 29.967 AU
Pluto 39.278 AU
**Generally, the "Low Earth orbit" altitude is about 100 miles (160 kilometers). One can theoretically have satellites at lower altitudes, but the satellite would have to constantly compensate for the high atmospheric drag with constant thrusts. Also, a satellite that is too low would experience rapid heating due to frictional effects.