
As a general rule, your food should be hung at least 10 feet off the ground and 4 feet away from the tree trunk, but check local requirements. In some parks and forests, hanging your food out of reach of bears is easy: use the cables, crossbars, or food poles generously provided by agencies such as the Park Service and Forest Service. Don't tie off your rope or cord on support poles because bears will sometimes climb those poles, bump the rope, see your food bag move, and make the connection.
If you're on your own, the counterbalance technique is the best method for hanging your food from a tree. In Yosemite, it merely forestalls the inevitable, but it will foil bears almost anywhere else. The idea is to hang two food sacks of equal weight way out on a tree branch where bears can't reach them. The main problem with the counterbalance technique is finding the right tree with the right branch. Your first requirement is a "live" branch at least 15 feet above the ground. The branch must be strong enough to support the weight of your food but not sturdy enough for a bear cub to walk on. You're looking for a branch about 4 to 5 inches in diameter at the base and only 1 inch in diameter at the point where you hang our food.
With the counterbalance method, your food must be at least 10 feet above the ground and 10 feet away from the tree trunk. You want your food sacks to hang bout 5 feet below the branch.

Properly executed, this technique will foil most bears, raccoons, and other late night raiders— but it's not bear-proof in places like Yosemite. It will buy you time, that's all. If you're lucky, you'll hear the bear(s) and have time to get out of your sleeping bag and take action before your food is gone.
You can also suspend a food bag on a rope strung between two trees conveniently located about 23 feet apart. You'll need 100 feet or more of 1/8-inch or larger nylon rope, a weight of some sort for throwing the rope over tree limbs, and a carabiner or short piece of nylon cord for attaching your food sack to the rope.
This system is fairly effective with novice bears. Experienced food robbers will wonder why you didn't set up a table with silverware for them. They'll simply rip off the line from the tree trunk and feast on your food when it falls down.
One last technique is to throw a line over a limb, suspend your food 12 feet above ground and 5 feet below the limb, and then tie the line off as high up on the tree trunk as you can reach. This technique is better than nothing with inexperienced bears, and it helps keep mice, squirrels, and other pests out of your food.
When your food is 12 feet high,wind will disperse the scent more than if it were on the ground. Keep your food in plastic bags to reduce odors.
Hanging food from tree branches can test your patience. It's easy to draw an illustration showing the perfect branch, but finding one in the field is another matter. You settle for a branch that looks right, but a tangle of other branches is in the way. Your aim is a little off and you're snagged on the wrong branch. You try again and this toss falls short. Then you hit the branch. Curses. When you finally manage to toss your rope over a limb, it's too close to the tree trunk and little nubs on the limb prevent you from moving the rope out where it should be. Reading step-by-step instructions for hanging food is far easier than doing it in the field; however, you need to be as persistent as the bears that might try getting your food.