Rabbi Levi said, "Recite a Psalm for the Sabbath day, for there is no darkness in it." It is written (Genesis 1:5), "And there was evening and there was morning, one day," referring to every day except for the Sabbath. Rabbi Levi bar Nissimah said, "The thirty-six hours of twilight on Friday signify the approach of the Sabbath, followed by the night and then the Sabbath day itself." When a person sees the departure of the Sabbath accompanied by the dimming of the sun and the onset of darkness, he begins to worry and say, "Woe is me, perhaps what God said (Isaiah 21:12) will happen to me: 'He will pour out my head like water.' " He brings the verse (Psalm 139:11), "But the darkness will cover me."
He sits and contemplates in his heart whether the serpent, which deceived him on the eve of the Sabbath, will come and bite him as retribution. A pillar of fire is sent to illuminate him and protect him from any harm. He sees the pillar of fire and rejoices in his heart, saying, "Now I know that God is with me." He blesses the Creator of the lights of fire and, when he withdraws his hand from the fire, he says, "Now I know that the Sabbath is distinguished from the weekdays, for we are not permitted to light a fire on the Sabbath."
He recites the blessing, "Blessed are You, who distinguishes between holy and mundane." Some say that God gave him two stones, one of darkness and one of brightness, as it is written (Job 28:3), "He has set an end to darkness," referring to the stone of darkness, "and all perfection he has created," referring to the stone of brightness. Adam, the first man, took the two stones and struck them together, and fire emerged from them, which distinguished between holy and mundane.
Therefore, we distinguish between light and darkness at the conclusion of the Sabbath. Rabbi Huna said, "We also distinguish between holy and mundane on Yom Kippur, by separating the light at the same time."