Surgical-style masks catch droplets going in either direction (of course) -- whatever protection it offers going out it offers going in as well, which is fairly obvious from a basic analysis. Of course it won't protect against individual viruses, but for many vectors that are not actually airborne but instead are in relatively large airborne droplets of fluid -- including this virus -- it can be of some use. Certainly better than nothing.
As a secondary benefit it stops you from touching the critical areas of your face. Given that we touch our face hundreds to thousands of times a day, a few adjustments of a mask aren't going to offset that.
The myth that the mask purely protects others is a myth that needs to die. At this point it is truly destructive.
Given that a surgical mask is only of limited protection, and not total protection, of course in actual contagion situations medication professionals should have something much better. Though we're in a situation right now where the CDC is telling medical professionals to fashion masks out of bandanas.
But when you see the streets of China where everyone is wearing surgical masks, or you see some old person walking around with one, note that it absolutely does reduce their risk. Not anywhere close to completely, but to some degree.