On Chanukah, my friend made 2 mistakes. First he made a bracha and lit the wick of his menora and then realized there was no oil. so the wick lit for a second and went out. Then he filled his menora with oil but took out the wick and lit it and then placed the wick in the oil. Was he yotzei in either cases and should he have made brachos in those cases?
In the first instance, the lighting of a wick alone would not be a significant lighting at all, and no mitzvah is fulfilled. Poskim discuss cases in which the amount of oil initially present was insufficient, in which a the candles must be lit again, but (according to most authorities) without a berachah. The case of a wick without any oil is worse, and one would have to light again with a berachah.
In the second instance, the principle is that hadlakah oseh mitzvah, meaning that the conditions must be right at the time of lighting. The wick was lit while still in his hand, which is surely wrong (1. no oil; 2. the wick was detached from the menorah, making the case worse than the case discussed by poskim of somebody who lit the menorah while holding it in his hand, and then set it in the prescribed place), and it would therefore seem that no mitzvah is fulfilled. However, it can be argued that because at the time of lighting, it is clear that the wick is due to be placed into the menorah, because the wick can obviously not last on its own, we see the wick as though it was in the menorah at the time of lighting, and the lighting is considered valid.
Sources: See Shulchan Aruch 675:1-2; Mishnah Berurah 8; Peri Chadash; Mishbetzos Zahav 3; Chayei Adam 154:21; Ben Ish Chai, Vayeishev 8.