In the Voyager episode: "Future's End, Part II" the doctor rescues B'elanna and Chakotay.
PORTER: They've got lasers! A black man and some bald guy. (The EMH enters. Porter and Butch's bullets go straight through him.)
PORTER: God in heaven help us.
EMH: Divine intervention is unlikely. (The EMH phaser stuns them, then unties Torres and Chakotay.)
In an earlier episode of Voyager, "Phage":
PARIS: But a hologram is just a projection of light held in a magnetic containment field. There's no real matter involved. (The EMH slaps Paris.)
EMH: Now, you hit me. (Paris's hand passes through the EMH's head.)
EMH: The magnetic containment field that creates the illusion of my body can be modulated to allow matter to pass through it or be stopped. I might be able to modulate the holographic lungs in the same way, allowing oxygen and carbon dioxide to pass from the lungs to the blood stream.
In order to make the above adjustments the doctor had to touch several buttons on a control panel. I realize the time I refer to above he was using the holo-emitter instead.
How does it work exactly that the doctor can have bullets pass straight through him but he's able to hold on to a phaser without it falling out of his hand? Can he simultaneously have part of his body be transparent and the rest be more like matter at the same time? What if the bullets hit the hand holding the phaser? I think one had a shotgun as I recall so there probably would have been pellets going all over the place.