It’s that time of year again. The days are growing shorter and colder, deadlines are imminent, and exams loom on the horizon. But the approach of winter doesn’t have to be all doom and gloom. Look up one of these nights at the northern sky, and you might see one of nature’s most fantastic shows – a dramatic display of vibrant colours dancing across the night sky: the northern lights, or aurora borealis.

The northern lights normally make their appearance in St Andrews a few times a year, appearing as a shifting, greenish cloud spread out across the northern horizon, attracting crowds of curious onlookers to the Scores and the pier. But, their enchanting aesthetics and romantic appeal aside, the northern lights have long been a mystery. For centuries, they were the subject of folklore and superstition. In Scottish Gaelic legend, they were said to be distant battles fought by heavenly warriors – or, by a different account, dancing spirits. It was only in the 18th century that scientists began to puzzle out the mysteries of the aurora. And only within the last century did researchers begin to unravel the specific details of what causes these haunting, luminous displays.

We now know that the lights we see abstractedly shifting in the sky are the result of countless collisions between electrically charged solar particles, and the gas molecules that make up the Earth’s atmosphere. To understand how this happens, we can trace the journey of these electrically charged particles back to their source.

The particles that will one day instigate such a fantastic spectacle begin their journey as a jumble of electrically charged subatomic particles in outer space. They are protons and electrons, ejected from the sun via an opening in the sun’s atmosphere, thereby causing a solar flare. These charged protons and electrons are then carried outwards to the rest of the solar system as part of the solar wind, also known as the steady stream of solar particles that constantly flows out from the sun into space.

Some of these particles reach Earth, after a nearly 150 million-kilometre voyage across the inner solar system. If the solar wind were to flow directly into the Earth, we would be bombarded with dangerous particles, and life would likely not exist. But fortunately, the Earth has its own magnetic field, thanks to our planet’s iron core. Projecting out beyond the atmosphere, this magnetic field bears the brunt of the solar wind, deflecting it and causing it to circumvent the planet – much like water flowing around a rock in a stream.

Yet the magnetic shield isn’t equally strong everywhere – near the north and south poles, it is actually quite weak. If a solar flare is large enough, then some of the particles carried by the solar wind could pass through this normally impenetrable barrier, causing a disturbance in the magnetic field, also called a geomagnetic storm. Some of these particles ultimately enter the Earth’s atmosphere, where they encounter resistance in the form of the gas molecules that make up the atmosphere.

And here, it is collisions with these gas molecules – or more accurately, the energy released from these collisions – that creates the vibrant light shows that we call the northern lights. The colour of the light depends on what gas is encountered by these invading solar particles, though the most common colour is green, created by collisions with oxygen. Occasionally, blue and red lights are also seen. These rarer lights are from collisions with nitrogen and higher-altitude oxygen.

The aurora can appear in a fantastic number of shapes: from bold streaks and waves to formless blobs, to thin lines, to nebulous clouds. The physics behind what produces this diversity of forms is still an active area of research. Although we may now know the basics of the northern lights, there is still much left to learn.

Far from being a passive light show, a potent aurora can also wreak havoc on the world’s communication systems. Since they are caused by electrically charged particles, during a strong aurora, there may be so much extra electricity coursing through the atmosphere that radio communications and electric grids can be disrupted. The strongest aurora in recent history, in 1859, was so powerful that it allowed telegraph lines to function without any power source. In other words, they were able to communicate using the electricity in the atmosphere itself!

St Andrews is far enough north that we are able to witness some of these celestial events, especially the more powerful ones. The northern lights are almost always seen in winter, when the nights are longest. Although they may occur in summer, the days are so long at that time of year that it scarcely gets dark enough to see any stars, let alone an aurora.

Yet Scotland is a mixed bag for the aurora-seeker: on the one hand, our northerly latitude makes it a good place to see the lights without having to travel to more polar regions; on the other, there is the tragic reality of Scottish weather, which has the unfortunate habit of bringing rain at the worst times. St Andrews is in a better situation than most in this respect, as Fife receives less cloud cover and rain than the west and the north of Scotland.

So, how can you go about preparing to see the northern lights? The unpredictability of solar flares and a variety of other variables make the northern lights notoriously difficult to predict more than a few hours in advance. The internet, especially social media, will be your go-to for updates. The AuroraWatch UK Facebook page posts regularly and reliably when abnormal geomagnetic activity is recorded, which might lead to a showing of the northern lights.

But let’s say that the conditions are all favourable, and there’s an aurora alert tonight and the skies are clear. Where should you go to make the most of these fortunate circumstances?

As a general rule, you will want to find an elevated place with a clear view of the northern horizon. Although in polar regions the northern lights can appear directly overhead, they are rarely strong enough to appear that way in St Andrews. The best viewing locations in St Andrews are the Scores, which provide an elevated vantage point with a clear view to the north, and the pier, which projects out far enough to make for a good viewing platform (despite being at sea level). Other exposed places, like one of the beaches, have the potential to be good viewing spots as well, but viewers should watch out for the tides.

At one of these locations, looking north on a clear night when they have been predicted, you should be able to see the green glow of the northern lights above the horizon. At first glance, you might mistake a yellowish glow for the lights, but this is just light pollution from our northern neighbours in Dundee. Disregard that, and instead, look for green whorls above the light pollution. As you look at them, they will oscillate and twist, almost like an optical illusion.

Many people expect the lights to appear exactly as they do in photographs – as dramatic waves of pulsating light. But exactly how bright and noticeable the lights are will depend on the strength of the aurora, or the number of solar particles that are entering the atmosphere. Some nights they are quite obvious; others, you will have to watch the sky closely to pick them out. They may also change in colour, starting out almost colourless before taking on a more vivid hue later in the night.

Although it is possible to have a fantastic display right here in town, the keen aurora-seeker might consider journeying farther afield. Although St Andrews and other nearby coastal towns are the premier aurora-viewing spots in Fife, a trip up to the darker, less light-polluted Highlands might provide a more vivid showing of the northern lights – that is, if you can avoid the more prevalent rain and clouds in these areas. For the best views in Scotland, however, the Outer Hebrides, Shetland, Orkney and other far-northern islands cannot be beaten, if you are willing to make the trip out to these distant locales.

No matter where you may find yourself on a dark, clear night this winter, be sure to take the time to turn your eyes skyward, and you might just see something breathtaking.