Which indefinite article is used before a letter? How do you decide? Is the way a letter is "spelled" the deciding factor?
Use "an" before a word starting with a vowel sound; otherwise use "a".
Usually this means that you use "an" if the word following starts with a vowel;
There are exceptions, most commonly when words start with the letter "H";
"spelling" is a contributing factor in whether a word starts with a vowel sound, but as can been seen (above) it is not the defining characteristic.