Lent is traditionally described as lasting for forty days, in commemoration of the forty days which, according to the Gospels of Matthew , Mark and Luke , Jesus spent fasting in the desert before the beginning of his public ministry , where he endured temptation by the Devil .