Meanings
From being grey (“gray”), a mix between black and white, morally grey/gray. From white hat + black hat. From cowboy country and western fiction, where good guys wear white Stetson hats with light attire, and bad guys wear black ones with black attire. From chivalric fiction, with white knights and black knights. From the association of the color white with good and black with evil.
How to pronounce "gray hat":
A morally ambiguous character; an antihero.
In the computer security community, a skilled hacker who sometimes acts legally and in good will and sometimes not. They are a hybrid between "white hat" and "black hat" hackers. They hack for no personal gain, and do not have malicious intentions, but do commit crimes.