The story that NASA spent $1 million to develop the space pen is a myth. Instead, the Fisher Pen company spent $1 million of its own money to make a zero-G pen, which NASA brought for $2.39 per pen. The Soviets also switched to pens as they were safer than pencils.
Extra info: Pencils were considered a risk on space flights because the tips could flake or break off and then drift around, potentially harming equipment or astronauts.
Source: Unbelievable Facts