Salt water is a strong anti-bacterial substance, so it's good for cleaning inside your mouth and your teeth also!
Some ailments inside the mouth are caused by bacteria, so that's probably why they're prescribed. But I never heard of them being used as a pain reliever. :o