The Mission & SOMA probably have the MOST and many of these are dance clubs or bars w/ live music --- a little funkier. The Marina & Cow Hollow have a lot of trendy, more yuppified bars, not as many for dancing/music. The areas really have much different vibes and cater to different crowds, with some crossover at certain places.
i bet SOMA has the most, but it depends on what you're looking for. downtown has a higher concentration of them (and probably anything commerce-related, i would guess), technically, but you probably won't hang there if you live here.
The highest concentration is probably in the Mission or North Beach, but there are bars all over the city and you can go to specific locations depending on the vibe you are after. Go to Yelp and click on the "nightlife" for more info.