I know that different rabbis have issued different rulings on whether it is permissible to light electric candles and recite the appropriate blessings. But do some rabbis permit it in some cases but not in others (Shabbat, Yom Tov, Hanukkah, Havdalah, yahrzeit, etc.)? What is their rationale?
This source presents a logical argument in favor of using electric candles for commemorating a yahrzeit: http://halachayomit.co.il/en/default.aspx?HalachaID=3863
In short, it says:
a) We do not say “Boreh Me’orei Ha’esh” over a yahrzeit candle
b) The candle is not meant to illuminate
c) Yahzeit candles are a minchag, not a mitzva
d) There are sources to rely on for using electric Shabbos candles
e) If we can use electric for a mitzva, surely we can use electric for a minchag
f) Rabbi Ovadia Yosef zt”l holds one use an electric light for a Yahrzeit for a parent
From Halachipedia (footnotes were just added inline parenthetically)
If one does not have a way of lighting real candles, one may be yotze by switching on electronic candles, and may recite the bracha too. [Shemiras Shabbos Kehilchasa 43:4, Rav Moshe Soloveitchik (quoted in Nefesh Harav pg. 155), Yabia Omer O.C. 2:17, and Rav Henkin (Eidus LeYisrael p. 122)]
Rav Ovadyah Yosef (Yalkut Yosef Shabbos vol 1 pg 188, Yabia Omer OC 2:17) agrees that one can make a bracha on it but emphasizes that it's only as a last resort, and that one should preferably designate the bulb for Shabbos candles.
Rav Shlomo Zalman Aurebach (Shemiras Shabbos Kehilchasa (ch. 43 fnt. 22) held that using an electric bulb plugged into the wall is questionable since the fuel to keep it lit on Shabbos wasn't present at the time of the lighting. Rav Moshe Feinstein (quoted by Rabbi Tendler in Moreshes Moshe v. 2 p. 51) agreed with this concern. However, R' S.Z. did permit battery powered lights, where the charge is all contained within.
R' Moshe Feinstein and Shu"t Shraga Hameir (5:11) rule not to say the blessing.
Those who are forced to use the electric lights instead of candles should turn on even those lights which are not normally used in order for there to be some distinction that the electric lights are in honor of Shabbos. (Tzitz Eliezer, V1 §20)
Some hold that there is a difference between an incandescent bulb and a fluorescent one. Rav Hershel Schachter (“Lighting Shabbos Candles,” min 36-7) holds that while one may light an incandescent bulb with a bracha, one may not light a fluorescent or neon bulb with a bracha. Rav Yitzchak Yosef (Motzei Shabbat Parshat Chukat 5778 min 38) held that any light even a florescent or LED light is effective for Shabbat candles.
In regards to Havdala, the halacha is the same. R' Chaim Ozer Grodzinski would use electronic bulbs every Motze Shabbos to demonstrate his position (he was one of the primary contenders to promote the belief that creating an electric light is considered a flame), according to Shaarim Metzuyanim Behalachah 96:6 and Nefesh Harav pg. 156. Others, however, held that in regards to Havdala, one cannot use electricity (R' Tzvi Pesach Frank, Har Tzvi 2:114).
Shabbos candles' goal is to increase lighting (to maximize Shlom Bays), therefore any lighting will do the job, incl. electricity. THe lights must be shut off before the blessing and lit back on.
Hannuka candles require a wick and a substance burning, so only candles will do. No electricity is Kosher here.
Yahrtzeit candles are pure Minhag, but they follow the Posuk "נר ה' נשמת אדם" (Mishlei 20) and therefore "require" a real candle when lighting at home, but it is customary to light electric "candle shaped" lamps in shuls or donor names boards. Of course, no blessing is said anyway.