M Source, which is sometimes referred to as M document, or simply M, comes from the M in "Matthean material". It is a hypothetical textual source for the Gospel of Matthew. M Source is defined as that special material of the Gospel of Matthew that is neither Q source nor Mark.
Nineteenth century New Testament scholars who rejected the traditional perspective of the priority of Matthew in favor of Marcan priority speculated that the authors of Matthew and Luke drew the material they have in common with the Gospel of Mark from that Gospel. Matthew and Luke, however, also share large sections of text which are not found in Mark. They suggested that neither Gospel drew upon the other, but upon a second common source, termed the Q.
This two-source hypothesis, speculates that Matthew borrowed from both Mark and a hypothetical sayings collection, called Q. For most scholars, the Q collection accounts for what Matthew and Luke share — sometimes in exactly the same words — but are not found in Mark. Examples of such material are the Devil's three temptations of Jesus, the Beatitudes, the Lord's Prayer and many individual sayings.
In The Four Gospels: A Study of Origins (1924), Burnett Hillman Streeter argued that a third source, referred to as M and also hypothetical, lies behind the material in Matthew that has no parallel in Mark or Luke. This Four Source Hypothesis posits that there were at least four sources to the Gospel of Matthew and the Gospel of Luke: the Gospel of Mark, and three lost sources: Q, M, and L. (M material is represented by green in the above chart.)