Even in solids, atoms/molecules do not cease movement entirely, they continue moving but slowly over short distances, held in place by attractions between the atoms/molecules. Usually these movements are random, and don't generate what we hear as sound. In the glass, the glass molecules make random movements that don't generate sound. However, if you drag a finger along the rim, you make some of the glass molecules move quickly in one direction then snap back. These molecules bounce into adjacent molecules making them move in the same direction, then the attraction pulls them back to their original position. This continues throughout the glass until it hits air, which conducts it to our ears, where we hear it as sound, or it hits a medium that cannot conduct that frequency e.g. water in the glass or the table.