In the military it's simple. Throw a grenade or two in, and then go in quickly. Repeat for the next room. Otherwise as you said, the first guy gets hit.
The police must handle hostage situations, so they use flashbangs, but they are usually against inexperienced criminals, so that helps too to survive.