A car's paint job is made up of three distinct levels of paint: primer, colour and clearcoat. A pearlcoat is an additional intermediary layer that's added between the colour and clearcoat. The pearlcoat itself is similar to a clearcoat except that it's been tinted to appear pearlescent. Scratches that reach down to this level can be repaired with relative ease.
Rub a light layer of shoe polish onto the scratched area. The shoe polish needs to be a colour that contrasts with your car's paint so that it is clearly visible. The process of fixing the scratch actually removes the surrounding paint rather than filling the scratched area; make sure you don't remove too much paint and cause further damage. Run a cloth rag over the area so that the scratches are completely filled.
Attach a piece of 2000-grit wet/dry sandpaper to a rubber sanding block and dip it in cold water. A few drops of liquid dish detergent helps decrease the friction and improve the cutting action of the ultrafine sandpaper.
Sand the damaged area using light, slow strokes. This is a very delicate process. Your goal is to remove enough of the surrounding paint to hide the scratch but not go deep enough to remove the pearlcoat. Alternate your movements so that the sandpaper approaches the scratch at a 60-degree angle instead of straight. Rinse the sandpaper frequently to remove any excess grit. Keep sanding until you can no longer see the shoe polish.
Allow the damaged area to dry completely. You may need to sand a bit more if there's still evidence of the scratch. Once the scratch is completely gone you should buff the area using a rubbing compound and a terry cloth washcloth. Buff in a circular motion and wipe away the hazy residue with the washcloth.
Remove any excess compound using a soft cloth and wash the area if necessary. Buff the area a second time with a very fine rubbing compound or a swirl-mark eliminator. Inspect the area a final time before applying a wax coat to seal the paint.
If any of the paint colour appears in the bucket of water your car needs a new clearcoat. Don't apply too much pressure when buffing or you may end up removing the pearlcoat entirely.