Murray is a common variation of the word Moray, an anglicisation of the Medieval Gaelic word Muireb (or Moreb); the b here was pronounced as v, hence the Latinization to Moravia. These names denote the district on the south shore of the Moray Firth, in Scotland. Murray is a direct transliteration of how Scottish people pronounce the word Moray.
The Murray spelling is no longer used for the geographical area, which is called Moray, but it became the commonest form of the surname, especially among Scottish emigrants, to the extent that the surname Murray is now much more common than the original surname Moray. See also Clan Murray.