"Ay Dios Mio" does, as previously stated, invoke "God" and should not be misunderstood simply because the word ends in an s. El Dios means God and is the masculine form -as indicated by "el." The plural is los dioses. Another singular Spanish word ending in the letter s is el paraguas, meaning an umbrella. The plural is los paraguas.
Spanish words take on masculine and feminine forms, even for inanimate objects; unlike English, were a simple "the" would be the definite article and "a" or "an" the indefinite article. "It" would be the requisite pronoun or adjective (determiner) to describe the object. In Spanish, the equivalent pronoun for the word, it, being ello or ella, is most often omitted completely, not being required. A sentence such as "Donde esta la biblia?" meaning, "Where is the bible?" may be answered by a simple, "Esta aqui," meaning,"It is here." There is no word to represent the it.
Some feminine examples of Spanish words, keeping with the religious theme, are la iglesia meaning church and la fe, faith whereas masculine forms include el Papa being the Pope and el Cielo for heaven.