Muzzle brake...
Imagine a large guy is running toward you, like the propelling gas traveling down a barrel. If you're standing still--like the ports on a brake are standing still on the barrel--and you bump the guy running just enough to slightly change his direction, you'll be knocked in the direction he's running. But, if you were the muzzle brake, you'd be conected to the barrel. And because the running guy you deflected pushes on you, you push on the barrel in the same direction the guy is going. Therefore, this pushing forward on the barrel causes some of the rearward force of the recoil to be cancelled, or braked.
To be more exact with the alalogy, the gas behind the bullet is trying to swell (expand)outward just as much as it ties to expand down the barrel. When the outwardly expanding gas reaches a port in the brake, it naturally tries to escape through that port. But, this gas still has a down-the-barrel speed, like the guy running toward you. So, the gas escaping through the port pushes against the wall of the port in the same direction the gas is going, which is down the barrel. So, the muzzle brake pulls on the barrel to cancel some recoil.
Make sense?