The closest I have heard to a rule on this is that if the h is not sounded and the initial syllable is accented the proper article is a, but if the initial syllable is not accented the proper article is an.

Thus, a history vs. an historical. This would explain why "[t]hey just taste better!"