The nearest airport to Fukui is in Komatsu. Buses connect Komatsu Airport with Komatsu Station for ¥260, from which you can take a Hokuriku Line local train for the 50 minute run to Fukui (¥820).
If coming internationally, the best airport to arrive in is Kansai Airport in Osaka. From Kansai Airport, you can reach Fukui by train in about 3 1/2 hours by taking the Haruka limited express train to Shin-Osaka, and transferring to the Thunderbird or Raicho, described below.
Fukui is connected to Kyoto and Osaka 1-2 times per hour by the Thunderbird and Raicho trains. Both of these trains make the run from Osaka to Fukui in about 1 hour, 50 minutes. From Kyoto, the run takes about 1 hour, 20 minutes. The price for both services is the same, at ¥5670 from Osaka and ¥4610 from Kyoto.
If coming from Tokyo, take the hourly Tokaido Shinkansen Hikari service that stops at Maibara station. From Maibara, take the Shirasagi to Fukui (3 1/2 hours, ¥13960).
There is no charge for the above services with the Japan Rail Pass.
The Dream Fukui overnight bus service runs from both Tokyo and Shinjuku to the Keifuku Bus Terminal in Fukui (9 hours, ¥8300 one-way). Two departures nightly.