[ Photo from Keetsa.com ]For the common surface scratch: Use a surface filler that matches the color of your floor to fill the crack, and then buff like mad to match the surface finish. If the scratch is deeper than you expect and you are feeling particularly brave, wet sand the area to the root of the scratch, and then reapply a new coat of polyurethane.
For water stains or pet damage: Make sure the area is dry and clean. Then, use a disc floor sander, sand the damaged area down to clean material. Grab a mop and bucket, and start applying coats of polyurethane. You'll want to taper off as you work towards the undamaged areas so the finish will be uniform. Lightly sand between coats so the new finish area will match as closely as possible to the older area.
Tips from Sean O'Halloran at DoItYourself.com.