Rats often squeak as a way to vocalize protest or to show stress. This is why rats often squeak when they are being petted or groomed by another rat. Small squeaks signal mild protest. Longer squeaks indicate distress, but such squeaks are usually only heard when a rat is confronted by another rat.
Not all rat squeaks indicate distress. Rats also squeak to indicate pleasure. However, pleasurable squeaks are of such a high pitch that they are outside the hearing range of humans. As a result, the only squeaks that humans hear are of stress or protest.
Squeaks are not the only noises that rats make. For example, rats also make a chattering noise, which is known as bruxing. Bruxing occurs when rats grind their front teeth together. This helps wear down the front teeth, which is necessary since the front teeth of rats are always growing. At times, however, rats have been known to grind their teeth during times of stress or when they are relaxed. When rats grind their teeth when relaxed, it's a reflex much like the purring of a cat.
Rats may also hiss. Hissing indicates distress and usually occurs in social situations with other rats.