We're all thinking of the movie. It can't be helped. Just look at the picture once; then we'll move on to the meteorological phenomenon and pretend that the movie never happened. Except for the song. Love that song.
Saint Elmo was the patron saint of sailors. He was thrown into a pit of vipers by pagans, only to emerge unscathed when lightning struck everyone around the pit. Surprisingly, this didn't stop the pagans, who threw him into another pit and tortured him in various ways for the rest of his life. God didn't step in after that first time, apparently not wanting to be one of those annoying helicopter deities.
Saint Elmo's Fire is the lightning-like glow that gathers around a ship's mast, usually towards the end of storm. Sailors considered it the saint's way of telling them they'd get through the storm alive.
The less faithful - or poetic - refer to Saint Elmo's as corona discharge. The tip of the ship's mast is attached to the ship, and to the ocean. It retains a certain charge, even though it's high up. The clouds above whip up a different charge, even when they are quite close to the ground. Since air is a very poor conductor of electricity, the difference between these two charges, insulated by air, can become greater and greater.
Eventually something has to give, and it turns out to be the air molecules. Electrons get stripped off the air molecules and wander away from their nuclei. This behavior is unusual for air, but quite common in other substances. There is one other material in particular that allows for positively charged nuclei and free-range electrons; metal. As most people know, metal is a good conductor. The difference between the charge of the storm above and the ship's mast - and consquently the ground - is so great that it causes the air to take on some of the properties of metal in order to equalize the charges.
Now that the air can conduct electricity, charge flows through it freely, turning the air around the mast into an electron rave. Electrons rush continuously through the air, bumping into each other, into regular air molecules, into ionized air molecules, and are generally pumped full of energy. Naturally, this energy can't last, and when the electrons come down from their excited states, they heave up a photon.
Some astute readers will recognize this as the way neon lights work. A charge differential is applied to a tube of gas, and when the gas molecules ionize, the rush of electrons giving off light. Neon gives off an orange-pink light. Oxygen and Nitrogen, two elements that make up air, give off blue light, which is what Saint Elmo's Fire looks like. Neon signs are basically Saint Elmo's Fire in tubes. Tubes that usually advertise beer. And naked women. I'm sure that's not blasphemous at all.
If it is, we'd probably all have been struck by lightning by now.