The drywall in the bathroom above the shower and bathtub is typically subjected to a daily onslaught of steam. If there's a lip at the top of the shower stall, water collects there and seeps into the drywall, causing it to soften and crumble. Although the sheetrock used in bathrooms is usually "greenboard," which has a moisture-resistant coating, it's not waterproof, and once water seeps into the tiniest crack or gap, it will start crumbling. Fixing bathroom drywall entails making the repair as watertight as possible.
Remove softened, crumbling drywall and scrape away peeling paint. If there's a large area of ruined drywall, cut it out with a utility knife. Scrape away loose caulking along the lip of the stall with a putty knife.
Attach at least one furring strip (1-by-3-inch piece of wood) to the back of the existing drywall with 1 5/8-inch drywall screws unless the drywall you've removed has exposed at least two wall studs. You will need something solid to attach the new drywall patch to, so extend the furring strip well past the margins of the missing drywall.
Cut a piece of greenboard drywall to fit the hole. Screw it into the studs or furring strips with the drywall screws.
Apply a coat of joint compound to the edges using a 6-inch drywall knife. Embed fiberglass mesh drywall tape in the wet compound, scrape off the excess and allow it to dry for at least eight hours.
Apply two more coats of joint compound, allowing it to dry completely in between coats. Sand the final coat smooth with 120-grit sandpaper, a drywall sanding screen or flexible sanding sponge.
Prime the patch with latex (water-based) primer.
Caulk along the top lip of the shower or bathtub stall with paintable silicone caulking. Allow this to dry for about eight hours before painting over the repair.