There are blood capsules, like large pills made from gelatin or similar and filled with blood. The actor can keep these in their mouth and bite them open on cue to provide a trickle of blood. This method allows the actor to have the blood ready for some time but still be able to speak so a scene can be filmed in a continuous shot.
For larger amounts of blood a simple solution is that they just have a mouthful of blood and spew it out on cue. Obviously you can only hold this amount of blood in your mouth for a limited time and so careful cutting and editing will be required to make the effect work.
For really large volumes of blood you would need a container concealed somewhere on the actor's body or otherwise out of shot with a tube running up to the actors mouth which can be concealed with clothing, makeup or prosthesis. Rather more care is needed in this case with camera angles and editing to make the effect work.
Of course in the case of zombies they will be wearing a lot of makeup and prosthetics anyway so there is more scope for hiding blood spray apparatus or even to use an entirely fake head for certain shots.
In the era of modern CGI a lot of blood and gore effects will be at least augmented if not done entirely with digital graphics in post production.