They're not perfect, but have been shown to reduce the distance of spread when coughing, talking etc in experiments.
Whether that translates to real life reduction of spread on a population level is less certain. Especially when you factor in human behaviors such as constantly touching the mask, then interacting with the environment without handwashing.
There has also been evidence to say that different materials have varying levels of efficacy. Some home-made face coverings have been shown to actually worsen spread of particulates.