Some days just seem cursed. The alarm doesn't go off on time, so you're late to work. An unexpected project bumps your lunchtime workout, and you realize you have no idea what to make for dinner. When you finally get home, you'd like nothing more than to dive face-first into a pile of fries with a side of triple-chocolate ice cream. But not so fast: Treating your bad mood with junk food will only get you more of the same. Instead, nurture your body and your mood with the best blues-busting foods around.

Leaf Greens

Leafy greens like spinach, chard, and collards are rich in folate, a B vitamin linked to mood disorders in people with deficiencies (Psychotherapy and Psychosomatics, 2003, vol. 72, no. 2). "B-vitamin deficiencies can be very subtle—it's not like your tongue suddenly swells up," says Cincinnati-based registered dietitian Becky Hand. "You feel irritable, out-of-sorts, and you don't know why." Your body needs folate and other B vitamins to produce neurotransmitters that regulate mood, including serotonin, the body's "feel-good" chemical.

All leafy greens are great folate sources; just 1 cooked cup of the most nutritious kinds (think collards and spinach) contains almost half the folate you need daily. Takeaway: Eat plenty of dark greens when you're feeling sad or overtired; try them chopped in soups, or sautéed as a side dish.

Caffeine: Watch it!
Coffee drinkers know well the perils of depending on the brew for a boost. One recent study found that caffeine users were even grouchier after they got their fix, whether they had had a good night's sleep or not (Human Psychopharmacology, 2004, vol. 19, no. 5). So be wise when it comes to tanking up on caffeinated beverages—and don't be surprised if it leaves you cranky.

—J.S.

Nuts and Seeds

Maybe birds are chirpy because of their diet: rich in nuts and seeds. Walnuts and flaxseeds contain mood-lifting omega-3 fatty acids, while almonds, Brazil nuts, pumpkin seeds, and sunflower seeds provide magnesium, which helps relax the body and soothe the mind. "People who eat processed foods—and that's most people—have a tough time getting enough magnesium," says registered dietitian Lisa Dorfman, author of The Vegetarian Sports Nutrition Guide (Wiley, 1999). "Deficiencies are incredibly common"—90 percent of her clients start out lacking magnesium, she says—"and [this] causes fatigue, irritability, and mood swings."

A small handful of nuts or seeds contains anywhere from 155 to 200 calories (so go easy) and varying amounts of magnesium. Walnuts contain about 45 mg per ounce; powerful pumpkin seeds contain 152 mg (women who are 31 to 50 need 320 mg a day). Takeaway: Munch nuts and seeds when you're feeling stressed, achy, or irritable.

Fish

When you're casting about for a mood lift, there's nothing better than fish. Tuna—even the canned kind—offers niacin, an anxiety-relieving B vitamin. (Because of mercury concerns, the FDA recommends no more than 12 ounces of tuna per week, less if you're pregnant.) Salmon, halibut, and sardines provide omega-3s, linked to mood in several studies (American Journal of Psychiatry, 2006, vol. 163, no. 6). An 8-ounce serving of salmon provides about 3 grams of omega-3s, the smallest amount found to be clinically effective for mood disorders. You'd need to eat two 3.5-ounce tins of sardines, two 6.5-ounce cans of tuna, or 24 ounces of halibut for the same effect—or you could go the luxury route with 4 ounces of caviar. Takeaway: Eat fish at least twice a week for mood-lifting omega-3s.

Beans

Pile your plate with beans and you'll be helping your body by stabilizing glucose levels, a key factor in mood swings. "There's a lot of good stuff in [beans] ... that helps regulate blood sugar so you don't eat, get high as a kite, and then crash hard," says nutritionist Kaayla T. Daniel, PhD, author of The Whole Soy Story (New Trends, 2005). Beans pack 230 to 300 calories per cup (cooked) and offer about one-fourth of your daily magnesium and iron; up to three-fourths of your daily folate; plus niacin, riboflavin, and other B vitamins. Takeaway: Beans are ideal when you're feeling tired, weak, and irritable. Stir cooked beans into soups, or serve with brown rice or millet.

Pasta

Noodles, particularly whole-wheat pasta, help the body access tryptophan, a precursor to serotonin. Researchers theorize that more tryptophan equals more serotonin, and test subjects have certainly reported feeling happier and more relaxed after munching on their chosen carb. "Just practice portion control!" warns Hand.

"A portion is half a cup, not 3 cups." Four ounces (about 1/2 cup) of cooked pasta contains about 74 mg of tryptophan and about 150 calories. Takeaway: When you're feeling wound up and restless, enjoy noodles with a vegetable marinara, sprinkled with nuts, or alongside broiled fish.

Joyce Slaton is a freelance writer and full-time mom who lives in San Francisco. She and her happy daughter eat beans and greens every day.