While it is true that air does not conduct electricity as nicely as water, it is also true that there is no (engineering) problem that cannot be solved by judicious application of brute force.
Lightning is a thing after all, so we know a discharge will happen in air if there is sufficient difference in electric potential.
Copy the design of the eel. This is what the wiki says about it:
In the electric eel, some 5,000 to 6,000 stacked electroplaques can make a shock up to 860 volts...
Now notice what the wiki says about its typical dimensions:
The electric eel has an elongated, cylindrical body, typically growing to about 2 m (6 ft 7 in) in length, and 20 kg (44 lb)...
If your unicorn weights as much as a draft horse... let's say one metric ton. It will have enough size and mass to have a lot more electroplaques. A back-of-the-napkin calculation says that, keeping the same volts-to-mass ratio, the unicorn will be able to produce 43,000 volts. You can buff that up - nothing is keeping the unicorn from having even more electroplaques. Let's say the unicorn is able to produce 50,000 volts. That is about as much as a typical low end Tesla coil:
The high electric field causes the air around the high voltage terminal to ionize and conduct electricity, allowing electricity to leak into the air in colorful corona discharges, brush discharges and streamer arcs.
A pointy part in a body is much more likely to produce a discharge than a round part or a toroid, so the horn is perfect for shooting out lightning. As for how the beast does not fry itself, it may have glass or some other very good electrical insulator material in its hooves.