The dark stains that form on a knife blade are simply oxidation (or rust). Still, those stains are a more stable, stubborn form of oxidation than orange rust. Because these stains are superficial, you might find that they respond to basic metal polishes; if not, then you must proceed to more aggressive methods such as sanding, until you are satisfied with the results. These methods are not suitable for antique or collectable knives. In that instance, seek a professional restorer, or you run the risk of devaluing the knife.
Check the value of your knife, if you think it is an antique or collectable one. If the knife is valuable, you are safe trying a metal polish, but find a professional restorer if the polish does not work.
Coat the blade with WD-40 or knife-honing oil. Allow the oil to sit a few minutes, then, buff the blade firmly with a soft rag or chamois cloth. This should remove very superficial stains (ones very recently formed).
Coat the blade with a cream or liquid-based metal polisher. Let it dry to a haze. First, try polishing it with your rag or chamois. If some staining remains, repeat this step, but use a buffing wheel or buffer on a drill and some elbow grease.
These polishes act chemically on the metal but also have a mild abrasive quality. Allow them to dry completely before buffing the blade.
Buff the blade with ultra-fine steel wool. Lay the blade on a piece of wood, so as not to cut yourself. Coat the blade with WD-40 or honing oil, and buff it with 000-grade steel wool, working from the base of the blade to the tip. Flip over the blade and repeat this step.
Buff the surfaces one last time, with 0000-grade steel wool (the finest available) to provide a near-perfect polish, then metal polish the blade to restore the shine.
Coat the blade with a protective finish, such as WD-40 or petroleum (presuming it is not a kitchen knife; if this is the case, use vegetable oil).
The dark stains will not impede the utility of the blade; if it is a kitchen blade or a utility knife, simply take more care to clean and maintain the blade. As an alternative to removing the stains completely, you might wish to "blue" the blade, which gives it a consistent, dark, blue-black finish. This oxidation reaction is the same as the oxidation that caused the staining but provides a consistent finish. Gunsmiths and hunting shops typically sell "cold bluing" compounds.