So, how can this problem of stray light be avoided? Simple, by applying special coatings to the filter. If one coating is added, the manufacturer usually refers to the filter as coated. If more than one coating is applied to the filter, the term multi-coated is often used. There is no way to easily tell if more than two layers are used, though better performance can be had with more coatings.
To understand why, Hoya FIlter, a maker of glass filters, explains the physics of coatings. While Hoya advertizes their solid glass filters, most filters have glass on the outer layers and so work similarly. The issue with light reflecting on the outer (front) surface of the filter is the main cause of issues. Ken Rockwell has a simple method to identify coated filters, simply hold a pen a few millimeters above the filter (not touching it). If you see the pen reflected twice in the surface, the filter is not coated. That is light that is not making it to the lens and a source of ghosting (usually not noticable, but it reduces the efficacy of the lens).