There's a law that says that when you fire a rifle, you'll get smacked, and it won't be by a policeman. Rather, the rifle itself will smack you right on the shoulder. This is due to what's called the rifle's "recoil."
Conservation Of Momentum
A rifle recoils because of the law of momentum. As you might expect, this law says that momentum is always conserved, so the forward-oriented momentum of the bullet equals the backward momentum of the recoil. But how can the momentum of the bullet and the recoil be equal if bullets are as fast as, well, a speeding bullet?
It's important to remember that speed and momentum are actually different albeit related things, so it's not the speed that has to be equal. Momentum depends on both speed and mass. While bullets have a very small mass and a very fast speed, because rifles have a relatively large mass compared to a bullet, the recoil has a relatively slow speed.
Why Not Black And Blue?
If recoil is a law of physics, it must happen every time a rifle is fired, but we know that hunters aren't beaten black and blue by their own rifles. Holding the rifle tightly to the shoulder makes the law of momentum work for you instead of against you.
When you hold a rifle this way, you make your body and the rifle act as one unit. Now, the forward momentum of the bullet must equal the backward momentum of the new rifle-person unit. The mass of the rifle and person together is so huge that the speed of the recoil becomes very small.