Sodium, in particular, is present in most compounds and will color the flame. Sometimes a colored glass is used to filter out light from one metal. Cobalt glass is often used to filter out the yellow of sodium.
Primary Reference: Lange's Handbook of Chemistry, 8th Edition, Handbook Publishers Inc., 1952.http://chemistry.about.com/library/weekly/aa110401a.htm (http://chemistry.about.com/library/weekly/aa110401a.htm)