Scratches in glass can be buffed out using a mild abrasive if the scratch is not too deep. Scratches deep enough to admit the tip of a fingernail usually can't be fixed. It is easy to break or distort glass while buffing, so consider taking delicate pieces to a professional.
To buff out scratches on glass, get jeweler's rouge or a whitening non-gel toothpaste, an electric buffer with a polishing pad, a spray bottle filled with a 1:32 mix of ammonia and water and paper towels or clean nonabrasive cloths. While buffing, wear a dust mask, safety goggles and rubber gloves.
Lay the glass on a flat surface. Put a small amount of jeweler's rouge or toothpaste on the buffer's pad. Buff the scratch at low to medium speed, or buff the scratch by hand using the polishing pad. Do not use sandpaper as this leaves an opaque patch on the glass. Be careful not to apply too much pressure.
After buffing, spray the glass with the ammonia-water mix and wipe it clean and dry. If the scratch is still present, repeat the process, but be aware that too much buffing can leave a shiny patch on the surface. Consider taking the piece to a professional if repeated buffings don't remove the scratch.