Ironically the "surgical masks' are not all that good at filtering air. Their main job is preventing sprayed spit from the wearer traveling to others. This they do pretty well.

On the other side a N-95 or better mask is fairly good job at filtering air. It isn't perfect but far better than nothing and a good bit better than a surgical mask. The ones with an exhalation valve are much more comfortable for hot weather or extended wear. A really big improvement. Trust me. Spend the extra money.

Either of these masks will offer some protection from sprayed spit coming at the wearer and will also serve to help keep the wearer's potentially contaminated hands away from their mouth and nose.

Using these two different masks some consideration needs to be taken to use the right one. A surgical mask will help prevent you from inhaling aerosols but not as well as a filter mask. A filter mask can help keep spit confined to the wearer but it is using a $7 mask to do what a $.50 surgical mask will do. And, it should be obvious, you wouldn't use a mask with an exhalation valve when the person is infected because the valve bypasses the filter when air is going out.