Basil doesn't really "bolt" the way the word is used to describe greens like lettuce, where the plant completely changes its growth habit and flavor. Just cut off the flower heads and keep on growin'. Basil can survive a pretty drastic trimming, so you can always cut the plant back by a quarter or a half and it will grow back bushier than before, provided it has a strong root system. The flowers themselves can be used the same way you use the leaves. They have a pretty similar flavor in most basil varieties I've grown.
Cedar's advice is spot on: in the future, if you want to prevent it flowering, just keep cutting it back. If you don't have a use for the fresh basil at that time, lay the leaves out on a window screen (not in direct sunlight) and dry them for future use. In any case, the plant isn't ruined (for food use) by flowering the way lettuce is.