According to most scholars, Mark was the first of the four gospels to be written. Matthew and Luke then relied upon Mark and a second written source called Q. What is the evidence for the existence of Q?
Q is an entirely theoretical document that nevertheless seems likely to have existed if Mark was the the first written Gospel.
It's long been known that Matthew, Mark, and Luke share significant material and we know from internal evidence that Luke incorporated a variety of sources:
Inasmuch as many have undertaken to compile a narrative of the things that have been accomplished among us, just as those who from the beginning were eyewitnesses and ministers of the word have delivered them to us, it seemed good to me also, having followed all things closely for some time past, to write an orderly account for you, most excellent Theophilus, that you may have certainty concerning the things you have been taught.—Luke 1:1-4 (ESV)
What are the other narratives1 he refers to? Matthew and Mark are obvious candidates as are Luke's unique sources for his genealogy, birth, and resurrection accounts. But as Beorn might have said, "This is the first time I've heard anyone call 3 or 4 many!"
The traditional view is that Matthew was the first written Gospel and that Mark summarized that account for easier consumption. More recently, however, scholars find the case for Markian priority stronger and therefore Matthew was an expansion of Mark. When all three synoptics share text (the triple-tradition), Luke invariably follows the Mark reading rather than the Matthew reading. This strongly suggests that Luke did not actually have access to Matthew as one of his sources.
But Luke does share material with Matthew. Many of these passages match nearly word-for-word. Consider, for instance Jesus' instruction to lay up treasure in heaven:
Sell your possessions, and give to the needy. Provide yourselves with moneybags that do not grow old, with a treasure in the heavens that does not fail, where no thief approaches and no moth destroys. For where your treasure is, there will your heart be also.—Luke 12:33-34 (ESV)
Do not lay up for yourselves treasures on earth, where moth and rust destroy and where thieves break in and steal, but lay up for yourselves treasures in heaven, where neither moth nor rust destroys and where thieves do not break in and steal. For where your treasure is, there your heart will be also.—Matthew 6:19-21 (ESV)
I've italicized the phrases that are strong parallels. Mark does not contain this saying, so Luke and Matthew could not have copied it from there. Therefore, if neither Luke nor Matthew copied from the other, they must have had a common source2 for this body of shared material. Since we have no documentary evidence of such a source, we simply label it with the German word for "source": Quelle.
Austin Farrer proposed a simpler hypothesis: Luke had access to both Mark and Matthew. Under this scenario, Luke would tend to follow Mark and supplement it with material from Matthew and from his own unique sources. Easily the most attractive element of the theory is that we can dispense with the Q proposal.
But the Farrer theory does not explain why or how Matthew and Luke could present contradictory evidence on key points of the story. What was Jesus' genealogy? Who was at the tomb when the women arrived? How many demon-possessed men or blind men did Jesus heal? How did Judas die? Why does Luke provide his own birth narratives and resurrection appearances without referencing Matthew's different accounts?
Farrer responded to similar objections:
No one has ever attached decisive importance to St. Luke's unexplained neglect of certain Matthaean texts, and whatever importance it ever had derived from an antiquated view of St. Luke's attitude to his work. If we regard him as essentially a collector of Christ's sayings, then the omission of some particularly striking blossom from his anthology may seem incompatible with his having known it. But if he was not making a collection but building an edifice, then he may have omitted what he omitted because it did not seem serviceable to his architecture nor come ready to his hand in the building of it.
That is certainly true, but we must follow that line of thought to discover what sort of edifice Luke was attempting to construct. Thankfully, Luke tells us in his prologue quoted above:
It seemed good to me also, having followed all things closely for some time past, to write an orderly account for you.
Assuming Theophilus had both Mark and Matthew in front of him, we can easily sympathize with his confusion. If we add in a few other traditions that we may or may not have, we can further empathize. But adding in Luke seems only to make the problem worse. As a historian, we would expect him to deal with the sources available to him and reconcile (or at least acknowledge) their apparent contradictions. Certainly Luke failed to harmonize the various accounts to the satisfaction of later readers.
Therefore, I find the simplicity of rejecting Q to be counter-balanced by the complexity of explaining Luke's purpose in writing his version of events. It seems more likely that Luke had many sources, but that Matthew was not among them. In this case, Luke succeeded in harmonizing Mark, Q, and Luke's unique sources of biographical information.
1. The NET Bible notes that Luke need not refer to written sources:
This is sometimes translated “narrative,” but the term itself can refer to an oral or written account. It is the verb “undertaken” which suggests a written account, since it literally is “to set one’s hand” to something (BDAG 386 s.v. ἐπιχειρέω). “Narrative” is too specific, denoting a particular genre of work for the accounts that existed in the earlier tradition. Not all of that material would have been narrative.
In terms of Q, this could imply that the source was oral rather than written. But most analysts find good reason to assume that Q was either written down or a product of careful rote memory.
2. One intriguing possibility is that Jesus was the common source. Although it's unlikely he would have written down his teaching, it's quite likely he required his disciples to memorize his version of the oral Torah. If Matthew really was the author of the gospel bearing his name, he could have simply penned (or dictated) the teaching from Jesus that he had memorized. Similarly, Luke could have transcribed the same material from some other disciple of Jesus. However, as Noah Snyder commented, "Matthew and Luke agree a lot in Greek, a common Aramaic source does not really explain that." This entire proposal is even more speculative than the Q hypothesis.
The Synoptics are very similar to each other, and it's almost universally agreed that this similarity is such that there had to be a literary relationship between them. That is, in many places the authors had access to one of the other Gospels, or that the authors of two gospels had a common written source.
There are two basic patterns which any solution to the Synoptic problem must explain:
The triple tradition, which is material shared between all three Synoptic gospels. Indeed this material is typically in the same order in all three. The most important feature of the triple tradition is that Mark is the "middle term," meaning that it's common for Matthew and Mark to agree with Luke different, or for Mark and Luke to agree with Matthew different, but rare for Matthew and Luke to agree with Mark different. Similarly, when the order disagrees usually Mark is not the odd one out. Finally, Mark consists almost entirely of triple tradition.
The double tradition, which is material shared between Matthew and Luke but not present in Mark. One notable feature is that most (but not all) of this material is sayings and not narrative. Another notable feature is that the ordering of this material is wildly different in Matthew (where it is in several large sermons) and Luke (where the sayings are spread throughout in smaller pieces).
There are two main theories which explain the pattern in the triple tradition:
Markan priority, which says that Mark was the first of the three to be written and that Matthew and Luke used Mark. Thus, when one of them modified Mark, the other one usually doesn't make the exact same changes, leaving Mark as the middle term.
Markan posteriority, which says that Mark was the last gospel written and was written to harmonize Matthew and Luke.
Most scholars find the case for Markan priority to be very strong (and from what I've read I have to say I find the arguments very compelling), but people who subscribe to Griesbach theory hold the latter position. There's already a great answer explaining the arguments for Markan priority, so I won't repeat them.
Assuming Markan priority, how are we to explain the double tradition? Again there are two main possibilities:
One of Matthew and Luke used the others gospel (typically Luke used Matthew, called Farrer theory).
Both Matthew and Luke had a common written source, but did not have access to each others gospels (this source is called Q, and this theory is called the two source theory).
Since those are essentially the only two possible explanations of the double traditions (assuming Markan priority) the main arguments for Q are arguments ruling out the first possibility. That is you argue that Luke couldn't possibly have had a copy of Matthew. Here are some of the arguments people make:
Matthew and Luke have very different birth narratives, genealogies, post-resurection accounts, and stories of Judas (assuming Luke wrote Acts). Thus it seems unlikely that they knew each other.
If Luke had access to Matthew why wouldn't he have used more of Matthew's modifications to Mark?
Some of the sayings in common appear to be in a "more original form" in Luke and others in Matthew. For example, Luke says "blessed are the poor" while Matthew says "blessed are the poor in spirit" and many people think the former was likely to be the original, hence Luke wasn't using Matthew but rather Matthew's source.
If you want to read more about this stuff, there's an introductory textbook available online: Mark Goodacre's The Synoptic Problem. I found it very readable. You should be warned that Goodacre is a proponent of Farrer theory and so disagrees with most scholars about whether Q exists. Nonetheless, he does present both sides of the argument at an introductory level. A shorter, but still thorough summary of the arguments for Markan priority and Q can be found at Peter Kirby's site. He find the arguments for Markan priority overwhelming, and leans towards the existence of Q.