Actually, the rule is that "an" should come before a word that starts with a vowel; the key thing is that this concerns pronunciation, not spelling; because English has such a horrid letter-sound relation, it can be confusing and you can't tell from the written form.
For example, the word "hour" begins with a silent "h" followed by a vowel, so it's "an hour". However, the "h" in "hamster" is pronounced, so it's "a hamster".
As a rule of thumb, I think most English nouns that are spelt with an initial "h" have it pronounced, I can't even think of another exception, besides "hour". But knowing English, I'm sure that there are more and some dialect-related complications.