I don't think there is a rule, not even an informal one. Off the top of my head I can't think of a regional accent that would claim a rule, nor an immigrant group that would struggle over it. I can't remember being corrected on my usage of either. I never think about it but I know I use both.
It has to be whatever is easiest for your mouth to pronounce in the particular sentence, as the word is everywhere. English did win the lottery in the "easiest definite article" category. Certainly not like Italian (shudder).