The words are by the English hymn writer Isaac Watts, who published them in 1719 in The Psalms of David Imitated, as a free version of Psalm 98. They describe the Lord coming to rule the earth rather than the Nativity - there are no shepherds, angels or manger in them - yet the hymn is now sung above all at Christmas.
The tune, called Antioch, was published in 1839 by Lowell Mason, a Boston hymn composer and teacher who brought music lessons into the city's public schools. Mason presented it as arranged from Handel, and its opening does recall phrases of Messiah, but no piece by Handel matches it, and today it is usually credited to Mason himself.
This transcription: Lowell Mason, hymn tune "Antioch" (1839), set to Isaac Watts's "Joy to the World" (1719): the melody in C major; left hand by GOONS Studio.
Transcribed by GOONS Studio from the original work, which is in the public domain.