Gray and grey are different spellings of the same word, and both are used throughout the English-speaking world. But gray is more common in American English, while grey is more common in all the other main varieties of English. In the U.K., for instance, grey appears about twenty times for every instance of gray. In the U.S. the ratio is reversed.
Both spellings, which have origins in the Old English grǽg, have existed hundreds of years.1 Grey gained ascendancy in all varieties of English in the early 18th century, but its dominance as the preferred form was checked when American writers adopted gray about a century later. As the Ngram below shows, this change in American English came around 1825. Since then, both forms have remained fairly common throughout the English-speaking world, but the favoring of gray in the U.S. and grey everywhere else has remained consistent.
Some people make their own distinctions between gray and grey. You can find some interesting examples in the comments below. There is nothing wrong with these preferences, but they are not borne out in broader usage. For most people, gray and grey are simply different spellings of the same word.
Both spellings are used for the participles, grayed/greyed and graying/greying, as well as for most of the words and phrases involving gray/grey. For instance, grey area/gray area, referring to an area having characteristics of two extremes, is commonly spelled both ways. So is graybeard/greybeard, referring to an older man with a beard, and gray squirrel/grey squirrel (which refer to closely related types of squirrels on opposite sides of the Atlantic). There are at least a couple of exceptions, though: greyhound, for the breed of dog, always has an e, while grayling, which refers to several types of fish, always has an a.
This Ngram graphs the use of gray and grey (as a percentage of all words) in American books, magazines, and journals published from 1800 to 2000:
And this Ngram shows the words’ use in British publications during the same period:
American publications almost always use gray, as in these examples:
Regional economic data released Tuesday highlighted just how many shades of gray now cloud the once-bright picture for emerging Asia. [NY Times]
When a Lincoln Navigator L with a gray interior arrived, Brown insisted on the black-on-black vehicle. [Washington Post]
Discipline has loopholes and gray areas. [Denver Post]
The graying of the globe is the result of elderly people living longer while families have fewer children. [Los Angeles Times]
Outside the U.S., grey is the preferred spelling:
Slap fresh bread around grey meat and it’s still a bad sandwich. [Globe and Mail]
The pressure also changed and the colour of the sky and sea transformed from metallic grey to a dust-red hue. [Guardian]
When it lives in the grey area between the two worlds, every day begins with a laborious examination of the numbers. [Sydney Morning Herald]
You only have to look at those photographs from May 2, 1997, and compare them to the gaunt, greyed Tony Blair of late 2003. [Telegraph]