Scratches on a picture frame, as well as separating joints and cracked glass, draw the eye away from the art and create a distraction. The most common problem is separating joints, and that usually occurs because the frame's joints weren't properly reinforced in the first place. You can fix that by screwing flat metal corner braces to the back of the frame. Keep in mind that repairing a frame with cracked glass is hazardous -- you need to take precautions to protect yourself as well as the artwork. Cover your work area and the floor if there is a chance of falling glass.
Take the frame off the wall and lay it face down on a table. If the glass is cracked, handle the frame gently and wear protective gloves.
Unscrew the hanger and clamps on the back of the frame with a screwdriver, and remove them. Lift out the backing board and the artwork, and lay it them flat in a safe place. If the glass is in once piece, lift it out and set it aside with the artwork. If the glass is cracked or broken, wear gloves while removing it and collect the pieces in a paper bag for disposal. You can't salvage cracked glass, even if there is only one crack.
Pull apart any loose joints. If you see nails or brads, pull them out with pliers. It's best to pull the entire frame apart and repair all the joints if more than one joint is loose.
Sand off the finish with 120-grit sandpaper if the frame is scratched. You don't need a sander to do this; just sand by hand, going with the grain. Continue sanding to smooth out the scratches once you've removed the finish.
Glue separated joints back together with carpenter's glue. Apply a small amount of glue to one of the pieces in each joint, and then assemble the frame and clamp it with corner clamps or a strap clamp. A strap clamp is preferable if you're gluing all four corners. Wipe excess glue from each corner with a damp cloth; let the glue dry overnight.
Turn the frame over and reinforce each joint by screwing on a corner brace. Use screws shorter than the thickness of the wood to avoid having them poke through the front of the frame.
Restore the color of the wood -- if you sanded it -- by brushing on a stain and wiping it dry. Finish the wood with three coats of spray lacquer from an aerosol can, sanding each coat with 320-grit sandpaper after it dries and before spraying the next.
Replace the glass. If you have to buy new glass, measure the inside dimensions of the frame with a tape measure; subtract 1/8 inch from the measurements, and cut the glass to these dimensions with a glass cutter. If you don't feel comfortable cutting glass, you can have it done at the hardware store.
Set the artwork and backing board in the frame and replace the clamps and hanger.