Most people know the story of "Silent Night" — how in 1818 in the little town of Oberndorf, Austria, Christmas Eve was almost upon them when the priest, Joseph Mohr, discovered that the organ didn't work.

Some say it was because of rust; some say that a mouse ate through the cables. Whatever the reason, it was unfixable.

So Mohr pulled out a poem he had written called "Stille Nacht, Heilige Nacht," and asked his friend and organist Franz Gruber to write a simple melody to it that could be played on the guitar. He did; the choir quickly learned the song; "Silent Night" became history.

While that story is often told as evidence of a Christmas miracle, other carols and songs also have interesting stories about how they came to be. Here's a sampling:

"It Came Upon The Midnight Clear" was also the result of last-minute inspiration.

In 1849, Edmund Sears, a Unitarian minister in Wayland, Mass., was working on his Christmas message. Concerned about both slavery and the poverty of his congregation, he was not in a festive mood until he read the account of Christmas in Luke. He began to write a poem that focused on that long-ago night, and used it to close his Christmas message. He also edited a magazine and published the words there, where they came to the attention of composer and music critic Richard Storrs Willis, who had written a song called "Carol." Willis noticed that Sears' words fit perfectly with his music, and a carol was born.

"Joy to the World" was not written as a Christmas song but rather as a hymn of praise by prolific English poet Isaac Watts. Originally, it was sung to the same music as "Come, Thou Fount of Every Blessing" until composer Lowell Mason noticed that the words fit with a song he had written.

Americans were the ones who liked it as a Christmas song — because it sounded like one.

Methodist clergyman Charles Wesley wrote the words to "Hark! The Herald Angels Sing." Felix Mendelssohn wrote the music. But it took a third person, a music arranger named William H. Cummings, to put them all together.

Cummings adapted the second chorus of Mendelsshon's "Elijah" to fit Wesley's words (previously sung to another tune). When the new version was published in 1856, it became an huge hit, and by the turn of the century was said to have been translated into more languages and included in more hymnals than any other Christmas song.

"Once in Royal David's City" began as a children's Sunday School song, written by Mrs. Cecil Frances Alexander, who was born in Dublin.

Her goal was to communicate, in a simple way through verse and song, the life and teachings of Jesus Christ. Alexander was also the author of "All Things Bright and Beautiful," "He Is Risen," and "There Is a Green Hill Far Away." So popular were her poems that on her death in 1895, a public day of mourning was declared, and more than 90 clergymen attended her funeral.

An early LDS contribution to Christmas music was "Far, Far Away on Judea's Plains," written in 1869 by John Macfarlane, a choir director in St. George.

He had asked his friend, Charles L. Walker, to write a suitable text, but when Macfarlane tried to set Walker's text to music, it just wouldn't come. According to his biography, "one night it came suddenly in a dream. John was awake instantly. He shook his wife, Ann, into wakefulness, crying out, 'Ann, Ann, I have the words for a song, and I think I have the music, too!' " The song was published in the Juvenile Instructor in 1889 and made its way into the LDS hymn book.

We can probably thank poet Christina Rossetti for our notion of a white Christmas. Although there was nothing scriptural to indicate the presence of snow, Rossetti's poem "In the Bleak Midwinter" conjured up a scene that has stuck around ever since. Gustav Holst, known for his symphony on the planets, set the poem to music and added to its appeal.

"Jingle Bells" was originally written by Bostonian James S. Pierpont for his father's Thanksgiving Sunday school class. But it soon caught on as a Christmas song and is thought to be the oldest secular Christmas song written in the United States. Penned in 1857, it became hugely popular during World War II when recordings by Bing Crosby and the Andrews Sisters sold more than a million copies.

"I'll Be Home for Christmas" was another wartime hit. Written by Kim Gannon, with music by Walter Kent (who also wrote music for "White Cliffs of Dover"), it was recorded by Bing Crosby in 1943 and became the No. 1 song that year.

Country western singer and actor Gene Autry wrote "Here Comes Santa Claus" in 1947 with composer Oakley Haldeman. Such was its immediate popularity that other singers quickly added it to their repertoire, including Doris Day, Eddie Fisher, Red Foley, Jimmy Boyd and Bing Crosby.

"White Christmas" is considered the most popular American Christmas song ever recorded. Bing Crosby's version alone has sold more than 31 million copies. The song, written in 1940 by Irving Berlin, was produced for a Bing Crosby-Fred Astaire film called "Holiday Inn" and won an Oscar when the film was released in 1942.

Sources: "Joy to the World: Sacred Christmas Music Through the Ages," and "Christmas Songs Made in America," by Albert J. & Shirley C. Menendez, "Stories of Our Mormon Hymns," by J. Spencer J. Cornwall.