Rambam opens the laws of Shabbat lighting by describing the duty to honor Shabbat with lights, the purpose of the candles, and the basic mitzvah of lighting in the home.
הַדְלָ [קַ] ת נֵר בְּשַׁבָּת אֵינָהּ רְשׁוּת אִם רָצָה מַדְלִיק וְאִם רָצָה אֵינוֹ מַדְלִיק. וְלֹא מִצְוָה שֶׁאֵינוֹ חַיָּב לִרְדֹּף אַחֲרֶיהָ עַד שֶׁיַּעֲשֶׂנָה כְּגוֹן עֵרוּבֵי חֲצֵרוֹת אוֹ נְטִילַת יָדַיִם לַאֲכִילָה אֶלָּא זֶה חוֹבָה. וְאֶחָד אֲנָשִׁים וְאֶחָד נָשִׁים חַיָּבִין לִהְיוֹת בְּבָתֵּיהֶן נֵר דָּלוּק בְּשַׁבָּת. אֲפִלּוּ אֵין לוֹ מַה יֹּאכַל שׁוֹאֵל עַל הַפְּתָחִים וְלוֹקֵחַ שֶׁמֶן וּמַדְלִיק אֶת הַנֵּר שֶׁזֶּה בִּכְלַל עֹנֶג שַׁבָּת. וְחַיָּב לְבָרֵךְ קֹדֶם הַדְלָקָה בָּרוּךְ אַתָּה ה' אֱלֹהֵינוּ מֶלֶךְ הָעוֹלָם אֲשֶׁר קִדְּשָׁנוּ בְּמִצְוֹתָיו וְצִוָּנוּ לְהַדְלִיק נֵר שֶׁל שַׁבָּת. כְּדֶרֶךְ שֶׁמְּבָרֵךְ עַל כָּל הַדְּבָרִים שֶׁהוּא חַיָּב בָּהֶם מִדִּבְרֵי סוֹפְרִים: הַמַּדְלִיק צָרִיךְ לְהַדְלִיק מִבְּעוֹד יוֹם קֹדֶם שְׁקִיעַת הַחַמָּה. וְנָשִׁים מְצֻוּוֹת עַל דָּבָר זֶה יוֹתֵר מִן הָאֲנָשִׁים לְפִי שֶׁהֵן מְצוּיוֹת בַּבָּתִּים וְהֵן הָעֲסוּקוֹת בִּמְלֶאכֶת הַבַּיִת. וְאַף עַל פִּי כֵן צָרִיךְ הָאִישׁ לְהַזְהִירָן וְלִבְדֹּק אוֹתָן עַל כָּךְ וְלוֹמַר לָהֶן וּלְאַנְשֵׁי בֵּיתוֹ עֶרֶב שַׁבָּת קֹדֶם שֶׁתֶּחְשַׁךְ הַדְלִיקוּ אֶת הַנֵּר. סְפֵק חֲשֵׁכָה וְנִכְנַס הַשַּׁבָּת סָפֵק לֹא נִכְנַס אֵין מַדְלִיקִין: פְּתִילָה שֶׁמַּדְלִיקִין בָּהּ לְשַׁבָּת אֵין עוֹשִׂין אוֹתָהּ מִדָּבָר שֶׁהָאוּר מְסַכְסֶכֶת בּוֹ כְּגוֹן צֶמֶר וְשֵׂעָר וּמֶשִׁי וְצֶמֶר הָאֶרֶז וּפִשְׁתָּן שֶׁלֹּא נֻפַּץ וְסִיב שֶׁל דֶּקֶל וּמִינֵי הָעֵץ הָרַכִּים וְכַיּוֹצֵא בָּהֶן. אֶלָּא מִדָּבָר שֶׁהָאוּר נִתְלֵית בּוֹ. כְּגוֹן פִּשְׁתָּה נְפוּצָה וּבִגְדֵי שֵׁשׁ וְצֶמֶר גֶּפֶן וְכַיּוֹצֵא בָּהֶן. וְהַמַּדְלִיק צָרִיךְ שֶׁיַּדְלִיק בְּרֹב הַיּוֹצֵא מִן הַפְּתִילָה:
The kindling of a Sabbath lamp is not a matter left to our volition - i.e., [it is not a matter about which,] if one desires, one may kindle it, but if one does not desire, one need not. Nor is it a mitzvah that we are not obligated to pursue - e.g., making an eruv for a courtyard or washing one's hands before eating. Instead, it is an obligation. Both men and women are obligated to have a lamp lit in their homes on the Sabbath. Even if a person does not have food to eat, he should beg from door to door and purchase oil to kindle a lamp, for this is included in [the mitzvah of] delighting in the Sabbath. One is obligated to recite a blessing before kindling [the Sabbath lamp], as one does before fulfilling any of the obligations incumbent upon us by virtue of Rabbinic decree. [The blessing is:] Blessed are You, God, our Lord who has sanctified us with His commandments and commanded us to light the Sabbath lamp. The person who lights the Sabbath lamp should light it while it is still day, before sunset. Women have a greater obligation in this regard than men, for they are normally at home and are involved in the household tasks. Nevertheless, a man should alert them concerning this matter and check that they have done so. He should tell the members of his household on the Sabbath eve before nightfall, "Kindle the lamp." If there is a question whether night has fallen and the Sabbath has commenced or whether the Sabbath has not commenced, the lamp should not be kindled. The wick used for the Sabbath lights should not be made from a substance that causes the light to flicker - e.g., wool, goat's hair, silk, cedar fiber, uncarded flax, palm bast, various types of soft trees, and the like. Instead, [we should use] a substance that burns steadily - e.g., carded flax, [remnants of] linen clothes, cotton, and the like. The person kindling [the lamp] should make sure that the fire has caught on the major portion of the wick that emerges [from the lamp].