The Talmud says that buying Hanukkah lights takes precedence over buying wine for kiddush, because the Hanukkah lights involve Pirsum Nes, the publicizing of the miracle of Hanukkah.
בעי רבא: נר חנוכה וקידוש היום מהו? קידוש היום עדיף – דתדיר, או דילמא: נר חנוכה עדיף, משום פרסומי ניסא? בתר דאבעיא הדר פשטה: נר חנוכה עדיף, משום פרסומי ניסא
“Rava raised a dilemma: [When the conflict is between oil for] a Hanukkah lamp [or wine for] kiddish of [shabbat] day, what is the ruling in that case? [Does] kiddish of [shabbat] day take priority [because it is] frequent, [i.e., it is performed every week, and there is a principle: When there is a conflict between a frequent practice and an infrequent practice, the frequent practice takes precedence?] Or, perhaps the Hanukkah lamp takes precedence due to the publicity of the miracle? After he raised the dilemma, he then resolved it [on his own and he ruled that, in that case, the] Hanukkah lamp takes precedence due to the publicity of the miracle.”
The Rambam takes this further and rules that one should even sell his clothing in order to buy the materials needed for kindling the Hanukkah lights. The Rambam writes, “The mitzvah of the Hanukkah lights is a most beloved mitzvah, and one must be very prudent in its fulfilment in order to publicise the miracle and to increase the praise of God and gratitude to Him for the miracles that He did for us. [Therefore,] even if one [is so poor that he] has nothing to eat except for what he takes from charity, he should borrow money or sell his clothing in order to buy oil and candles to light” (Hilchot Hanukkah 4:12).
What is the Rambam’s source for this ruling?
(a) The Magid Mishnah explains that the Rambam’s source is the Talmud here, which says that the publicizing of the mitzvah of Hanukkah makes the Hanukkah lights more important than kiddush. We find with regard to the Four Cups of wine of the Seder night that if one cannot afford to buy wine, he should take charity in order to buy wine to fulfill the mitzvah. The Talmud in Pesachim (112a) says that the Four Cups also serve to publicize a miracle. If one must take from charity in order to fulfill the mitzvah of the Four Cups, then all the more so must one take from charity or sell one’s clothing in order to fulfill the mitzvah of the Hanukkah lights.
(b) The Vilna Ga’on (Bi’ur HaGra OC 671) says that the source for this law is as follows. The Talmud in Pesachim (112a) says that even a poor person who is already supported by the communal charity fund should take more charity in order to provide a minimal amount of food in honour of Shabbat.
The Rashbam, in his comments to the Mishnah in Pesachim (99b), says that taking from charity means even hiring oneself out or selling one’s clothing. The Talmud there (Pesachim 105b) says that one must rely on charity if he does not have enough money to buy wine for kiddush. Since the Talmud here says that the Hanukkah lights take precedence over kiddush, we may derive that certainly one must sell his clothing to buy Hanukkah lights.
(c) The Rogatchover in Tzafnat Pane’ach says that it is not necessary to prove from the Talmud in Pesachim that one is required to sell his clothing in order to buy wine for kiddush, because the Talmud elsewhere says so explicitly. The Talmud in Megilah (27b) relates that some of the Amora’im sold their clothing in order to buy wine for kiddush. Since the Talmud here says that the Hanukkah lights take precedence over kiddush, we may derive that certainly one must sell his clothing to buy Hanukkah lights.