Check to make sure the water channel drains are not clogged with dirt, leaves, etc. Look for some holes in the rear ward part of the sunroof track and try blasting some compressed air in them. A long piece of heavy gauge wire will also work.
Another test would be to pour a small amount of water in the track and see if it drains out, typically the water runs out ahead of the rear wheels, might be from a slot or a round hole in the sheet metal underneath the car.
Inspect the rubber gasket the glass seals against. Awhile back another guy posted that the gasket is not sold separately, you have to buy the whole sunroof assembly for Mega $$$.
Good luck
========= Harryface =========
1991 Pontiac Bonneville LE ~_~_~269,000 miles_~_~_