Ghosts are not bothered by visible light. They are invisible themselves so you need invisible light to drive them away. The simplest way to do this is put a thin insulating disc (2 circles of paper with a layer of garlic skin between them works well) between the batteries and the positive contact in your flashlight. The paper stops the regular electrons that make visible light from entering the bulb or led, while the garlic skin amplifies the ecto-electrons that make invisible light. As an added bonus this also works against vampires. Beware of the very cheap anti-ghost lights you see on places like Deal Extreme, since they often just leave out the batteries completely, stopping both visible and invisible light, so you think you are safe but in fact you are completely exposed.