From the Free Dictionary:
The history of the word dirge illustrates how a word with neutral connotations, such as direct, can become emotionally charged because of a specialized use. The Latin word dirige is a form of the verb dirigere, "to direct, guide," that is used in uttering commands*. In the Office of the Dead dirige is the first word in the opening of the antiphon for the first nocturn of Matins: "Dirige, Domine, Deus meus, in conspectu tuo viam meam," "Direct, O Lord, my God, my way in thy sight." The part of the Office of the Dead that begins with this antiphon was named Dirige in Ecclesiastical Latin. This word with this meaning was borrowed into English as dirige, first recorded in a work possibly written before 1200. Dirige
was then extended to refer to the chanting or reading of the Office of
the Dead as part of a funeral or memorial service. In Middle English
the word was shortened to dirge**, although it was pronounced as
two syllables. After the Middle Ages the word took on its more general
senses of "a funeral hymn or lament" and "a mournful poem or musical
composition," and developed its one-syllable pronunciation.
"Dirige me, Domine" is from the Latin translation of the eighth verse of Psalm 5; the chant is illustrated above in the selection from the Poissy Antiphonal, dated between 1335 and 1345. For more information on this antiphonal, visit this LaTrobe University site. Psalm 5 also provides the text of the Wesley hymn, "Lead Me, Lord."
*AKA the imperative
**pronounced DEER-juh (whereas the Latin would be DEE-ree-jay)