Are you conscientiously eating calcium-rich foods and following your doctor’s orders about calcium supplement use? That’s good—but not good enough to ensure that your bones benefit. Reason: Some foods contain substances that interfere with calcium absorption, so whatever else you eat along with your calcium influences how much of the mineral goes to your bones…and how much literally gets flushed away when you go to the bathroom.

To tip this balance in your favor, it helps to allow a few hours to elapse between eating the foods that you rely on for calcium and eating the types of foods that reduce calcium absorption, I heard from Elson M. Haas, MD, an integrative physician in San Rafael, California, and author of Staying Healthy with Nutrition: The Complete Guide to Diet and Nutritional Medicine. So just what kinds of foods are we talking about?

Calcium-rich foods: These include beans (great northern, navy, white)…Chinese cabbage…dairy products…fortified cereals…leafy greens (beet greens, collards, dandelion greens, kale, turnip greens)…nuts…okra…rice…seafood (crab, salmon, ocean perch, sardines, shrimp)…seeds…and soy products.

Here’s what interferes with calcium…

Sodium. When you eat too much sodium, the excess is excreted in your urine—but when that sodium leaves your body, it drags calcium with it. Best: Limit daily consumption of sodium to no more than 2,300 mg or about the amount in one teaspoon of salt. What if you do go overboard on salt? Potassium helps limit sodium-induced calcium excretion, so have a high-potassium food (banana, cantaloupe) with your calcium, Dr. Haas suggested.

Caffeine. Do you often have calcium-rich yogurt for breakfast or take your calcium pill with your morning meal—then wash it down with a big mug of coffee or tea? Caffeine from any source works against strong bones by interfering with calcium absorption and causing more of the mineral to be lost through the urine. Better: Have your morning yogurt with a glass of orange juice instead, since its vitamin C and magnesium improve calcium absorption…or take your supplement in the afternoon or evening, after you’ve finished drinking coffee for the day.

Phytates. Found in high-fiber foods such as berries, corn, nuts, oatmeal, rye and especially wheat bran, phytates are substances that bind calcium, reducing its absorption. Fiber-rich foods have many health benefits, so of course you don’t want to shun them…but if you’re increasing your fiber intake (for instance, to help regulate digestion), be sure to increase your calcium intake, too.

Phosphorus. This mineral, which is plentiful in meat and poultry, has many important functions in the body. But for proper bone density, a delicate balance must be maintained between phosphorus and calcium—which means that as phosphorus intake increases, the need for calcium increases, too. Problem: Ideally, people should eat more calcium than phosphorus, but the typical meat-focused Western diet contains roughly two to four times more phosphorus than calcium. Also, because both phosphorus and calcium require vitamin D for absorption, phosphorus-rich foods compete with calcium-rich foods for the available vitamin D. Bone smart: Ask your doctor about supplementing with vitamin D. Also, cut back on meat and focus more on plant foods…and be aware that carbonated beverages such as colas have as much as 500 mg of phosphorus in one serving—so say “so long” to soda.

Nighttime note: Has your doctor recommended calcium supplements? Choose a brand that also includes magnesium for maximum absorption…and take half of your daily dose at bedtime, Dr. Haas suggested—it may even help you relax and sleep better.