Bears aren't necessarily attracted to fire, but that doesn't mean a fire at night will keep a bear away from a campsite especially if it smells food. One of the best deterrents to keep bears away, is to keep food smells well away from a campsite (cook / eat food at least 100 feet away from where you sleep) and use a bear canister or hanging sealed bear bag.
Along with taking proper care of food, talking or noise will also help to keep bears away. If you believe a bear is near your campsite, yell, clap, or bang pots together in order to scare it away.