When you feel sad, your dog will immediately pick up on this and adjust his behavior accordingly. He may become more subdued than usual, lose interest in his toys and even refuse his food.
Usually, your dog will quietly observe you from a corner of the room. After a while, he may come over and lie down at your feet or gently rest his head in your lap. Many dogs will even try to lick away tears as they fall. A dog's master is the center of his entire world, so sensing your feelings of sadness will have an effect on him too.
In a study published in the journal "Animal Cognition", researchers found that a dog was more likely to approach someone who was crying than someone who was humming or talking. Furthermore, they found that dogs respond to weeping with submissive behavior.
In other words, dogs seem to be trying to placate a person who is upset. What is more, dogs will approach anyone who is upset the same way, regardless of whether that person is their owner or not.