The trail is an aerodynamic contrail – short for condensation trail – as opposed to the more common jet contrails that are formed of exhaust fumes.
Aerodynamic contrails occur when a plane lowers the air pressure as it flies, in turn lowering the air temperature and causing condensation to form on the wings. This condensation then trails behind as the plane continues forward.
In certain humid conditions, the drop in temperature and pressure is such that the droplets of condensation will freeze at varying sizes.
When the sunlight shines through these different sized droplets, it will refract at different wavelengths, hence the variety of colours that can be seen.
Photographer Nick Beyersdorf captured the phenomenon from the ground in Bamberg, Germany.