Scrape the substance gently with a butter knife to remove as much as you can. Take your time when scraping so the tar-like substance does not spread. Blot with a dry rag to further remove the substance.
Moisten a sponge with dry cleaning solvent, and sponge it onto the stain to soak it.
Press a clean rag over the stain to soak the liquid from the carpet. Continue sponging with dry cleaning solvent, then blotting with a dry rag until the rag comes back clean, indicating that the sticky substance is no longer coming out of the carpet.
Mix 1 tablespoon of white vinegar, 1 tablespoon of dishwashing soap and 2 cups of warm water. Sponge this mixture onto the tar stain. Press a rag over the spot to soak up the liquid.
Sponge cold water onto the area, and blot it again to dry.
Mix 4 parts warm water and 1 part liquid carpet shampoo if any of the substance remains. Sponge the shampoo solution onto the spot. Allow the carpet to dry completely, then vacuum the carpet. Repeat this process as necessary until all the stain is gone.