In many bathrooms, the shower drain is connected to a 3-inch waste pipe shared by the toilet and possibly another fixture, such as the sink. That pipe empties into the soil stack, which is a vertical pipe that extends to the sewer. Each fixture has a vent pipe that connects to the main vent stack, which reaches from the top of the soil stack through the roof. These vents are a vital part of the drain network. If they are blocked or not functioning, flowing water in the pipes creates a vacuum that has a number of effects, including producing a gurgling sound and a bad smell from the shower.
When water is flowing through pipes, it naturally seals them and creates a head of air in front of it and a force of suction behind. The purpose of the vents is to admit air and equalize the pressure. When they are blocked, the suction slows down the flow of water, allowing sediment to settle out and causing frequent blockages. It can also suck water from the P-traps of fixture drains, such as that for the shower. Without a pool of water in the trap, there is nothing to prevent sewer gases from escaping.
Depending on your pipe configuration, a blockage in the toilet drain line can also block some vents, and plunging or snaking the toilet may clear it. You should cover the shower drain, and any other drains connected to the waste line to maximize the effect of the plunger. If the problem persists, you may have to clear the main vent stack. This involves climbing on the roof, so if you aren't comfortable climbing on the roof, or your roof is steep, you may want to consider getting professional help for this job.
Once you're on the roof, you may notice debris blocking the vent opening, and clearing it may solve the problem. The debris may be deeper in the stack or near a bend in the pipe, however. One way to clear it is to spray water into the vent opening with a garden hose; the water may push the debris into the sewer. If the water backs up, clear the pipe with a plumbing auger. Use one long enough to reach the sewer -- 20 feet is usually sufficient. You'll know the blockage is clear when water flows freely.