There used to be a rule that a word starting with an aspirated H would take "a" if its first syllable was stressed and "an" if it wasn't. Although you will still find some who follow this rule, it has pretty much gone by the boards.