The Fisher Space Pen was designed by Paul C. Fisher for the Apollo Program. Due to the hostile space environment, there were strict design requirements for the pen; it should be able to write in a vacuum, in the absence of gravity and at temperatures varying from -120 °C to 150 °C. Fisher had worked on a pen design with a pressurized ink cartridge. This design was perfected in 1966, and in October 1968 the first Space Pen was used in the Apollo 7 mission.

The ink of the Space Pen is fed to the ball point by pressurized nitrogen, and thus can be used to write upside down and in a vacuum. Due to the thixotropic behavior of the ink it remains highly viscous and won't leak when the pen is not in use. When the ink is put in motion by the ball point, its viscosity will drop so that it starts flowing. The composition of the ink allows for writing on a wide array of surfaces, under water, and also at extreme temperatures.

There is a great urban legend regarding the design of the space pen:

When NASA started the space program in the 1960's, they were faced with the problem of writing in space. NASA spared costs nor efforts design a pen that would perform in a vacuum, and in the absence of gravity. Fortunately, the resulting Space Pen was a true marvel of engineering that proved its worth in the early space missions. The enthusiastic NASA engineers showed off the Space Pen to a group of Soviet-engineers working for the Russian space program, and asked them how they had solved the problem of writing in space.

"We use pencils", was their reply.

Although there is a valid lesson to be learned from this story (Keep It Simple, Stupid!), it is merely an urban legend. Prior to the Apollo 7 mission, both Russian Cosmonauts and American Astronauts were relying on pencils for writing in space. However, sometimes the pencil leads would break and go on a free flight in the space capsule. The lead tips could float into an eye or nose, or even into electrical devices causing a short circuit. Furthermore, the wood and lead of the pencils could burn rapidly in a pure oxygen environment. Because of a fire in Apollo 1 (resulting in the death of three astronauts), NASA required a writing instrument that would not burn in a 100% oxygen atmosphere, and would operate in space conditions.

Sources:
(urban legend)
http://www.spacepen.com/
http://www.snopes.com/business/genius/spacepen.htm