Scala 2.8, 311 314 320 330 332 336 341 375 characters
including long word adjustment. Ideas borrowed from the other solutions.
Now as a script (a.scala):
val t="\\w+\\b(?w).mapValues(_.size).toSeq.sortBy(-_._2)take 22
def b(p:Int)="_"*(p*(for((w,c)<-t)yield(76.0-w.size)/c).min).toInt
println(" "+b(t(0)._2))
for(p<-t)printf("|%s| %s \n",b(p._2),p._1)
Run with
scala -howtorun:script a.scala alice.txt
BTW, the edit from 314 to 311 characters actually removes only 1 character. Someone got the counting wrong before (Windows CRs?).