Often the straps that secure the pipe leading to a shower-head become loose creating an annoying rattle as the shower is pressurized. To alleviate this without tearing into the wall to re-secure the pipe, try using expandable foam.
Pull back the trim ring from the wall and inject the foam into the cavity behind the wall. Be careful not to overfill as the foam can buckle the drywall as it expands if you use too much. Once the foam is in, push the trim ring back in place to contain the foam and wait for it to dry.