Vitamin B12 is a vitamin that helps synthesize brain chemicals responsible for mood. In more scientific terms, it's involved in the synthesis of S-adenosylmethionine (SAMe), which acts as a donor of methyl molecules to a variety of brain chemicals, including neurotransmitters that are involved in mood regulation, such as serotonin. Because of this, a vitamin B12 deficiency could conceivably be a cause of depression.
If you are experiencing depression and are older, have a gastrointestinal condition, or have been eating either a poor diet or a vegetarian diet -- any of which could make you more prone to a vitamin B12 deficiency -- it might be worth getting your B12 levels evaluated with a simple blood test.
You can get more vitamin B12 in your diet either by taking a supplement or by improving your intake of foods rich in this vitamin.
If you choose to take a supplement, some experts recommend that you take it in the form of vitamin B complex, which contains a mix of all the B vitamins in ratios similar to those found in nature. Rakel's Integrative Medicine recommends B complex 100 as the best dose due to the potential toxicity of higher levels of vitamin B6.
Foods which are rich in vitamin B12 include animal products, such as fish, meat, poultry, eggs, milk and milk products. Although vitamin B12 is generally not found in plant foods, breakfast cereals may be fortified with vitamin B12. Some nutritional yeast products (like Marmite) also contain vitamin B12.
Rakel, David, ed. Integrative Medicine. 2nd ed. Philadelphia: Saunders Elsevier, 2007.