The Vaigai is a river in the Tamil Nadu state of southern India; it passes through the towns of Theni, Dindigul and Madurai .