It's not uncommon to see a dog pant and drool when he's hot, but when it happens at odd times, it can signal a bigger problem. Panting and excess salivation can make it look like a dog is foaming at the mouth, a classic sign of rabies. With rabies being relatively uncommon in domesticated dogs, the problem is more likely another type of illness or anxiety.
When It's Normal
Dogs don't sweat like people do, so they must lower their body temperatures somehow when they get hot. They do this by panting, and it's common to see a dog pant when it's hot outside or after exercise. It's normal to see saliva dripping off a dog's mouth as he pants from the heat, although some dogs drool more than others. When your dog isn't hot but he's still panting and drooling, it could be a sign of a problem.
Anxiety or Stress
Dogs communicate with us fairly effectively even though they can't talk. When a dog is anxious or stressed, he's likely to pace and whine or drool and pant. He's trying to express his anxiety and ask for comfort. If ignored, his anxiety can cause him to be destructive, such as tearing couch cushions apart, or harm himself, such as breaking off claws as he tries to dig out of his crate. Separation anxiety is one of the more common causes, but the stress of a move or a new family addition, such as a baby or new puppy, can also cause panting and salivation. If the behavior continues, your vet might recommend sedatives or behavioral therapy.
Nausea or Bitter Taste
Dogs will eat nearly anything, but that doesn't mean they always like it. When they eat something that tastes exceptionally bad or bitter, they start salivating immediately and often pant to help push the taste out of their mouths. This often makes them look like they're foaming at the mouth. They also flick their tongues in and out quickly. These symptoms can mean the dog is feeling nauseous, which could be simple digestive upset or a sign of poisoning. Call your vet to determine the proper course of action.
Pain
Some dogs whine when they're in pain, but others pant and drool instead. Although panting can signify pain anywhere in the dog's body, panting combined with drooling typically occurs when the pain is in his mouth. This can be from periodontal disease or an abscessed tooth, for example. Your vet can help you determine the source of the pain and suggest the best treatment.
Illness
A scarier side of panting and drooling symptoms is a serious illness, such as heart failure, respiratory distress and cancer. Dogs pant and salivate when they are having trouble swallowing and breathing, which can be a sign of pneumonia or congestive heart failure. Call your vet immediately if the panting gets severe or is accompanied by coughing.