How old is the hamster? What are you using as bedding? What about food? How long has the hamster been doing this.
It sounds like severe respiratory infection that needs medical treatment as soon as possible. When a hamster starts breathing and gasping for breath, it is on the last leg, so to speak.
I wouldn't think wettail, unless the bottom is wet. That wasn't a symptom that was given.