The Gospels offer several stories of women who come to anoint Jesus. Some of these are clearly parallels, but one seems not to be.
The parallel stories are found in Matt. 26, Mark 14, Luke 7, and John 12. It is my argument that we have only two incidents reported, but by only two different women -- Mary the sister of Martha (Matthew, Mark and John), and an unnamed woman who was a sinner (Luke).
Some preliminary critical questions:
- Is it likely that there would be two such anointings during Jesus' ministry?
Not at all unlikely. Keener [Matthew commentary, 618] reports that anointing the head with oil was a typical banquet custom for honored guests. Mary would have been quite in line with normal practices of hospitality to anoint her own guest. The woman's actions in Luke were more risky (as we shall see) but she would have been using a customary practice.
- Why do the stories sound so much the same, if they are reporting different events?
The simple answer to this is that the stories took on some of the same characteristics during a period of oral transmission. We shall see, though, that events reported to be the same are mostly events which would have to accompany any anointing, whereas the details differ in ways indicating different incidents. Furthermore, if there are only two stories, and Luke is the "odd man out," this is what we would expect.
- Where was Jesus?
- Matthew -- in Bethany, in the house of Simon the leper
- Mark -- agrees with Matthew
- Luke -- a Pharisee's house, but no location is given; the Pharisee's name is given later as Simon
- John -- with Mary and Martha and Lazarus, in Bethany
Two points need to be made here.
First, it is assumed often that John 12 has Jesus at the house of the Martha, Mary and Lazarus family. This is not said at all in the text. It is said that Martha served, and that Lazarus sat at the table -- but was only one of the people at the table.
This does not mean that it was all held at their household. Indeed, if this is at the house of Simon the Leper, he would have to have had someone else serve the food; as a leper he was ritually unclean and was unable to serve himself, and likely had servants to do the job if he was holding a banquet. One suggests that Martha was in his employ.
Second, how likely is it that both incidents involved a man named Simon? Quite likely -- as likely as there being 19 men named Simon in the works of Josephus. This was the name of one of Israel's tribes, as was Judas, Levi, and other names popular at this time; Simon was also the name of a great Maccabbean hero [Witherington, Mark commentary, 367n]. Jesus' apostolic band had two Simons (Pete and Zealot) and three Jameses (brother of John, son of Alphaeus, Jesus' brother). Josephus has 9 Jonathans.
- Who was the woman?
- Matthew -- no specifics are given
- Mark -- also no specifics
- Luke -- "woman in the city, which was a sinner"
- John -- Mary, the sister of Martha and Lazarus
This fits in fine with the idea that Mary is the one in Matthew and Mark doing the anointing. Why was she not named? Likely because until John wrote his Gospel, to name her or her siblings would have endangered them with the authorities. (Cf. John 12:10!)
- What did she do?
- Matthew -- having an alabaster box of very precious ointment, and poured it on his head, as he sat at meat
- Mark -- agrees with Matthew
- Luke -- "...when she knew that Jesus sat at meat in the Pharisee's house, brought an alabaster box of ointment, And stood at his feet behind him weeping, and began to wash his feet with tears, and did wipe them with the hairs of her head, and kissed his feet, and anointed them with the ointment."
- John -- "Mary [took] a pound of ointment of spikenard, very costly, and anointed the feet of Jesus, and wiped his feet with her hair: and the house was filled with the odour of the ointment."
The similarities here are expected in light of historical constraints. Ointment or nard (a type of ointment) was usually kept in alabaster bottles that were specially sealed to prevent evaporation. The neck of the container was broken and the ointment expended all at once. The feet and the head were the normal targets for such attention, so that we have the same report in that regard is not surprising.
The only oddity is that John mentions feet only, whereas Matthew and Mark report the head only, and both report the woman's use of her hair whereas Matthew and Mark do not. However, Witherington notes [John commentary, 207] that the differing focus would serve a symbolic purpose in line with each writer's theology: the anointing of the head symbolizes kingship, while the anointing of the feet symbolizes Jesus' being glorified in death.
The wiping of the feet with the hair is not unusual either as it reflects "the ancient practice of diners' wiping excess oil or other potable substances from their hands onto a servant's hair."  It is not clear whether this was done by Jesus' own request or by the womens' initiative.
- What was the reaction?
- Matthew -- But when his disciples saw it, they had indignation, saying, To what purpose is this waste? For this ointment might have been sold for much, and given to the poor. When Jesus understood it, he said unto them, Why trouble ye the woman? for she hath wrought a good work upon me. For ye have the poor always with you; but me ye have not always. For in that she hath poured this ointment on my body, she did it for my burial. Verily I say unto you, Wheresoever this gospel shall be preached in the whole world, there shall also this, that this woman hath done, be told for a memorial of her.
- Mark -- agrees with Matthew, though using different verbiage
- Luke -- Simon wonders at this, and Jesus offers a parable about the forgiveness of sins
- John -- Then saith one of his disciples, Judas Iscariot, Simon's son, which should betray him, Why was not this ointment sold for three hundred pence, and given to the poor? This he said, not that he cared for the poor; but because he was a thief, and had the bag, and bare what was put therein. Then said Jesus, Let her alone: against the day of my burying hath she kept this. For the poor always ye have with you; but me ye have not always.
This fits well if John, Mark and Matthew report the same event and Luke another. John differs in focusing in on Judas Iscariot, from whom it is clear he has a distaste, and reports a different part of Jesus' reaction.
In conclusion: We have only two anointings and two women here, and while we have some differing focal points, we have no contradictions as such. The variations we see are no less or more than we would expect from stories that went through the process of oral tradition. (Though there are also signs, especially here, that John at least knew Mark's account; see here.)