IT”S A COMET! IT”S A METEOR! That’s probably the first reaction on seeing this picture of a celestial body with a tail.
But no. It’s actually Mercury. Yeah, that’s right. Turns out Mercury has a vapor trail as it moves around in space. It's the only planet in the solar system to be showing this property, and why it happens is quite interesting. But before that, let's look at why a normal comet forms a tail.
A comet is a rocky body made of dust and ice. They follow highly elliptical orbits around the sun, into the cold reaches of the Oort cloud, and back almost touching the atmosphere of the sun. While we have catalogued about 7000 comets, it's expected that there are many more comets near their aphelion in the far reaches of the Oort Cloud.
A comet can be thought of as a combination of three parts. First, you've got the Nucleus. Like the name suggests, it's the solid core of the comet. Next, you've got the coma, which is the gas and dust floating around the comet. And finally, the tail, which is visible only as it approaches the sun.
And just like asteroids, comets come in all shapes and sizes. While the smallest known ones are still a 100 meters in diameter, the largest ones are nearly a hundred kilometers in diameter.
As comets come close to the sun, they start heating up, and the ice from the nucleus sublimates into a gas, and the trapped dust is released as well. This gas and dust is what forms the coma, and it moves around the nucleus. The gases are then ionized by the solar radiation, and turned into plasma. This combination of plasma and dust is pushed outward, and away from the sun. It's similar to how on a windy day, regardless of the direction you walk, the scarf and jacket you're wearing fly in the direction of the wind, not the direction you're walking in. Similarly, regardless of the direction the comet is travelling, the comet's tail will always point away from the sun. The solar wind sometimes affects the dust and the plasma differently, so they might even appear to have two tails. 
But what about the other thing in the sky that shows a trail? Meteors? You have beautiful meteor showers as stars streak across the night sky almost once a month. How do they work?
Well, a comet has an icy nucleus that sublimates into gas as it heats up approaching the sun. That happens enough times, the ice will break into smaller pieces, and will disintegrate into little pieces of rocks that are left behind as debris.
As earth is going on in its orbit, if there's any debris that is encountered by the earth's atmosphere, they burn up as they're pulled in by the earth's gravity. The meteor shower we see, is just the little rock burning up thanks to atmospheric resistance and giving off heat and light. 
And the name of a meteor shower? Though meteor showers are coming from debris from comets, and happen annually as we intersect a particular Comet's orbit, they're not named after their parent comet. Instead, they're named after the constellation they appear to come from. Hence, a meteor shower coming from the Leo constellation would be a Leonid, or a meteor shower coming from the constellation Perseus would be the Perseids.
But none of these explanations apply to the first photo we see. Mercury doesn't melt as it goes close to the sun. It doesn't burn up in any atmosphere. So what is causing the vapor trail behind Mercury?
Perhaps this photo could shed some light. The author of the tweet, Dr Sebastian Voltmer mentions that the image was captured using a Sodium filter to get better visibility. That suggests the trail is mostly Sodium...... Wait a minute, why is Mercury spitting out Sodium? Where did that come from?
Well, being such a small planet, Mercury does not have a full fledged atmosphere like Venus or Earth. It just grabs the particles kicked up by the sun, such as Oxygen, Potassium, Hydrogen, Helium, and of course, Sodium. It's gravitationally bound to the planet, but it's not really dense enough to behave as a gas.
So, you've got a thin layer of gases loosely bound to a rock, in a region that's constantly bombarded by Solar Radiation. A similar process to what happens with comets occurs. Solar Radiation ionizes and pushes these particles, mostly Sodium, away from the sun as Mercury moves in its orbit. And this trail could possibly reach 3.5 Million kilometers from the planet. 
It's not just Mercury that does this. Even Venus has a similar, but much weaker tail, made of oxygen ions. It's not as dense as that of Mercury, but it certainly exists. 
Earth also has a tail, but it's not one that can be observed with a telescope. Instead, it's a tail of a magnetic field. Unlike Mercury, we have a well developed atmosphere and magnetic field, so that mechanism wouldn't exactly work. However, when Solar Wind comes and hits Earth, the resulting interaction with the Earth's magnetic field results in what we call a Magnetosphere. On one side, facing the sun, it is compressed into a region that is around 22 thousand kilometers away from the surface of the Earth. However, on the other side, facing away from the sun, it extends far beyond the orbit of the Moon as well. 
In Fact, this was one of the mission parameters of the now famous Chandrayaan-2 Mission. Every time the moon orbits the earth, it spends about 6 days in this Geotail of the Magnetosphere. As the Chandrayaan-2 is orbitting the moon, it will also spend 6 days in this Geotail, giving the scientists an opportunity to place instruments and study the properties of the Magnetotail.
And Earth isn't the only planet in the solar system to have a magnetosphere with such a long tail. Jupiter has the largest magnetosphere of any body in the solar system. While most of the mechanics of Jupiter's Magnetosphere is similar to the Earth, there's an interesting Variable here in the form of the Volcanically active moon, Io, which leads to the formation of a Torus like structure in the magnetosphere.
If you thought it was just Comets that had a cool looking tail, think again. The night sky is filled with beautiful phenomenon, some which we can see, and many more that we can't.
The next time you look up into the sky for Mercury, keep an eye out for a long tail. If you're lucky, you just might spot it.