Glass didn't start out as its own thing. For thousands of years before people created glass windows, containers or figurines, they used the substance as a strong, translucent coating for pottery. It took a few more centuries for until Egyptians learned to forge glass -- with its own unique properties -- into novel shapes. And then their products were slowly spread through Europe by Phoenician traders.
The art of making glass, in fact, probably grew out of the field of pottery, most likely in Egypt from about 4,000 B.C., towards the end of the Neolithic era. Glass is made from heating a clean mixture of soda, lime, and sand until it melts into a liquid. Its earliest use was most likely as a glaze to strengthen pottery.
Objects made solely from glass didn't start appearing for another few thousand years. Glass vessels started showing up about 1,500 B.C., the products of what we now know as glass-blowing. The mixture, which was applied as a moist powder, for the glaze had more sand and less lime. It had to be fired with charcoal, which would provide the 1,000 degrees needed to melt the substance.
Molding the glass to desired characteristics can be tricky. The glass had to be cooled slowly -- too quick and the gas bubbles won't escape, or it could crystallize. The three basic ingredients when mixed will produce a clear glass, but even trace elements of other minerals could change the color of the resulting product. A bit of copper provides a deep blue-green color, for instance. The colorless glasses of ancient Alexandria were given their unique shade by silver grains of sand. Much of the glass we see today comes with greenish-brown color, thanks to the iron present in much sand.
It appears that Egypt led the way in terms of moving glass production, having factories in place by the mid-1300s. Slowly, over the following centuries, glass products made their way across the Near East and, by Phoenician traders, through Europe by the 7th or 8th centuries B.C.
--Summarized from "A Short History of Technology: From the Earliest Times to A.D. 1900."