The blood comes out of your hamster's mouth in case of an injury. The best thing you should do in this regard is to take your hamster to the vet as soon as possible. Never forget that an expert vet can come up with the best diagnosis.