Energy bars are usually used as a pre-run snack or for post-run recovery. (You could use them on the run but few runners find solids easy to eat on the move).
Their advantages: they're portable and they tend to have a good balance of fast- and slow-release carbohydrate, a bit of protein for recovery, and low levels of fat.
How to choose an energy bar
There’s a huge range of energy bars available, though the carbohydrates in different bars tend to come from similar sources: rice, oats and, in a few products, maltodextrin for complex carbs, and dried fruit or fructose and glucose syrup for simple carbs.
Other varients include chocolate coatings (nice, though the higher fat content makes them less digestible on the run), and high-protein bars (best for body-builders or recovery from very high-intensity sessions).
Make sure you have your bar with enough water (at least 250ml) to replace the fluids you lose in sweat, as well as to help digest the bar.