I have heard several countries expressed in Spanish with a definite article before the country name (e.g. *los Estados Unidos*, *la Argentina*, *la India*). Is there a rule for when this occurs and when it doesn't? Is the definite article optional, or are there certain countries for which it is required? If both forms are used, which is more common?
There is no rule. Many country names may optionally be preceded by an article: (el) Canada, (los) United States, (la) India, (el) Lebanon, (el) Perú, etc.. Please refer to this article for more info:
Unfortunately, there is no rule for this since this is a mater of toponymy, the branch of onomastics. Places are named the way they are and some of them take the article and some don't.
Here is a list of names of countries in Spanish, those which take the article have them marked in parenthesis. you will find their demonym or gentilic at the end of each line also.