Often called the Neapolitan sixth chord (because it typically occurs in first inversion), the Neapolitan chord is simply another S-type chord: it functions as a pre-dominant chord, preceding V (or I64) in much the same way as IV or ii6 or ii65.
Spelling it: It's a major triad built on b2. Therefore, it's spelled b2 4 b6 (or in minor mode just b2 4 6). Since it often occurs in first inversion, the 4th scale degree is often in the bass (note the similarity to other pre-dominant chords).
Doubling: double the third of the chord (scale degree 4). If it's in first inversionanalyzed as N6you would then double the bass note. The underlying principle here is that if at all possible you should not double chromatically altered notes.
Voice leading: two important things must be remembered: 1) use contrary motionjust like IVV or ii6V, there should be contrary motion between bass and upper voices for N6V; and 2) scale degree b2 must work its way down to 7, sooner or later. This brings up the one exception to "normal" voice leading: b27 forms a diminished third, but it is commonly used in the progression N6V (or N6V7).
The N6 chord often proceeds to: V, V7, i64, (or I64), or o7/V (far less often to V65/V).
A typical progression: i o7/iv iv o7/V V VI N6 i64 V i
It may also be used as a pivot chord in a modulation: it would usually be a diatonic chord in one key and a chromatic chord in the other (which comes first doesn't matter).