The Christmas lights of today can light up trees and window frames with tiny twinkling lights of many colors—or cause frustration with their long and tangle-prone cables. But the first such lights, introduced to the holiday world in 1882 by Edward Johnson, a friend, and partner of light-bulb inventor Thomas Edison, were a different story.

In 1871, Johnson hired Edison, then a 24-year-old inventor, as a consultant for the Automatic Telegraph Company. Edison “ate at this desk and slept in a chair,” Johnson later recalled. “In six weeks he had gone through the books, written a volume of abstracts, and made two thousand experiments…and produced a solution.”

So impressed was Johnson that when Edison left to start a new company, he followed, quickly making himself useful turning Edison’s brainstorms into patenting opportunities. In 1877, after Edison invented the phonograph, Johnson took the machine on tour, charging crowds to drum up excitement. When Edison patented the light bulb in 1880, its exact value was hard to gauge; widespread electrification was still decades away. Still, Johnson, Edison, and others invested $35,000 to form the Edison Lamp Company to sell the bulbs.

Johnson didn’t introduce the idea of using light to celebrate the holiday; the tradition of making the winter festive with the light and warmth of fire is much older than electricity. For many years, those who could afford to would express their Christmas spirit by lighting candles on trees. But what really made a tree a Christmas tree were the candles, and while flickering flames were festive, they were also a fire hazard.

Edward Johnson’s idea was to replace the candles with a string of colored electric lights, which he did with eight bulky, pear-shaped bulbs on a single wire. Several publications covered his lighting of the first tree, which rotated as the red, white and blue lights dazzled spectators. But the idea didn’t catch on widely in the U.S. since many Americans didn’t entirely trust electricity and the bulbs were too expensive to be practical. A string of 16 vaguely flame-shaped bulbs sitting in brass sockets the size of shot glasses sold for a pricey $12 (about $350 in today’s money) in 1900.

We tend to think of Christmas-season traditions as ancient, but most of them are rather recent, born in the 19th century. President Franklin Pierce put the first Christmas Tree up at the White House in 1856, and by the 1870s fresh-cut trees were being sold at Washington Square Park and pretty ornaments at Macy’s. President Grover Cleveland also helped make the lights popular after he used them to light a Christmas tree in the White House in 1895. By 1914, a 16-foot string cost just $1.75, and by the 1930s, colored bulbs and cones were everywhere.

Today an estimated 150 million light sets are sold in America each year, adding to the tangled millions stuffed into boxes each January. They light 80 million homes and consume 6 percent of the nation’s electrical load each December. And though the contagious joy of these lights has been co-opted orange at Halloween and red at Valentine’s Day, it all started with Johnson’s miracle on 36th Street.