The usual way to get to the Grottes de Han by public transport is by train line 162 Brussels - Luxembourg, getting off at Jemelle and then taking TEC bus 29 Jemelle - Grupont, which stops at Han-sur-lesse (8km from Jemelle), for timetable see TEC site or http://www.damier.be/fiche.php?localite=792.
Stops on the line from Namur to Luxembourg are: NAMUR, Jambes-Est, Dave-Saint-Martin, Naninne, Sart-Bernard, Courrier, Assesse, Floree, Natoye, CINEY, Leignon, Chapois, Haversin, Aye, Marloie, JEMELLE, Forrieres, Grupont, Poix-Saint-Hubert, LIBRAMONT....
To get from DINANT to Jemelle by train you would have to go via Namur or Libramont, but the most logical-looking way would be to take bus 43 from Dinant to Ciney and train from there. All of these possibilities take between 1h40 and 2h, depending on time of day and connections, total time from Dinant to Han-sur-Lesse a bit more than 2hrs. As you have probably already found out, these possibilities show up if you put Dinant and Han-sur-Lesse into the boxes on http://www.b-rail.be/main/E/ (it then asks you to confirm that you mean Dinant (B) i.e. station and Han-sur-Lesse (T) which means TEC bus stop). I'm afraid there is no direct bus between Dinant and Han-sur-Lesse, so you will have to go via Jemelle.
Or, Han-sur-Lesse is 37 km from Dinant by road, so by taxi it would only take about 45 mins; you might consider phoning/e-mailing a taxi company to find out how much this would cost, e.g.:
- Taxi Mosan, tel. 082 22 78 88, taxismosan@yahoo.fr
- Allotax, tel. 082 22 94 94 / 0497 92 92 92, allotax@hotmail.com.
I checked to see whether it would be easier to get from Dinant to the Grottes de Neptune at Pétigny, which I really liked for the boat trip and son-et-lumière; but you would also have to go via Namur or else take 2 buses (via Heer Pont), total travel time up to 2h26 so slightly more than to Han!