This paper proposes a flexible rerouting strategy for the public transit to accommodate the spatio-temporal variation in the travel demand. Transit routes are typically static in nature, i.e., the buses serve well-defined routes; this results in people living in away from the bus routes choose alternate transit modes such as private automotive vehicles resulting in ever-increasing traffic congestion. In the flex-transit mode, we reroute the buses to accommodate high travel demand areas away from the static routes considering its spatio-temporal variation. We perform clustering to identify several flex stops; these are stops not on the static routes, but with high travel demand around them. We divide the bus stops on the static routes into critical and non-critical bus stops; critical bus stops refer to transfer points, where people change bus routes to reach their destinations. In the existing static scheduling process, some slack time is provided at the end of each trip to account for any travel delays. Thus, the additional travel time incurred due to taking flexible routes is constrained to be less than the available slack time. We use the percent increase in travel demand to analyze the effectiveness of the rerouting process. The proposed methodology is demonstrated using real-world travel data for Route 7 operated by the Nashville Metropolitan Transit Authority (MTA).