Method of thermal treatment of hot rails to obtain a desired microstructure having enhanced mechanical properties, the method comprising an active cooling phase wherein the rail is fast cooled from an austenite temperature and subsequently soft cooled, to maintain a target transformation temperature between defined values, the cooling treatment being performed by a plurality of cooling modules (12.n), each cooling module comprising a plurality of means spraying a cooling medium onto the rail, the process being characterised in that it comprises: - providing each cooling module with a plurality of cooling sections, each section being located in a plane transversal to the rail when the rail is within the thermal treatment system, each section comprising at least: - one cooling means located above the head of the rail, - two (N2, N3) cooling means located on each side of the head of the rail and, - one cooling means located under the feet of the rail, - during the active cooling phase, each cooling means is driven to control the cooling rate of the rail such that the amount of transformed austenite within the rail is not lower than 50 % on rail surface and not lower than 20% at rail head core, wherein: - the cooling rate can be set at different values along said thermal treatment system, - a first phase (Ia) for said fast cooling has a cooling rate between 25 and 70°C/s by first cooling modules to obtain a bainitic rail, - each cooling means for said subsequent soft cooling is individually controlled under four further phases (lb, II, III, IV) with different decreasing cooling rates between 0.5 and 25°C/s along the plurality of further cooling modules, - each cooling means is driven to control the cooling rate of the rail such that the austenite is transformed into high performance bainite in the whole rail section and for obtaining fully pearlite fine microstructure in a selected portion of the rail section, wherein, - to obtain a bainitic rail, the rail is controlled to enter the first module with a temperature of about 800°C and subsequently, in said first phase (Ia) the rail skin is fast cooled down to a temperature of 350°C, - to obtain a pearlitic rail, the rail is controlled to enter the first module with a temperature in a range of about 850°C and subsequently, in said first phase (Ia) the rail skin is fast cooled down to a temperature of about 560°C by fast cooling means with a cooling rate comprised between 25°C/s to 45°C/s. - providing each cooling module with a plurality of cooling sections, each section being located in a plane transversal to the rail when the rail is within the thermal treatment system, each section comprising at least: - one cooling means located above the head of the rail, - two (N2, N3) cooling means located on each side of the head of the rail and, - one cooling means located under the feet of the rail, - during the active cooling phase, each cooling means is driven to control the cooling rate of the rail such that the amount of transformed austenite within the rail is not lower than 50 % on rail surface and not lower than 20% at rail head core, - the cooling rate can be set at different values along said thermal treatment system, - a first phase (Ia) for said fast cooling has a cooling rate between 25 and 70°C/s by first cooling modules to obtain a bainitic rail, - each cooling means for said subsequent soft cooling is individually controlled under four further phases (lb, II, III, IV) with different decreasing cooling rates between 0.5 and 25°C/s along the plurality of further cooling modules, - each cooling means is driven to control the cooling rate of the rail such that the austenite is transformed into high performance bainite in the whole rail section and for obtaining fully pearlite fine microstructure in a selected portion of the rail section, wherein, - to obtain a bainitic rail, the rail is controlled to enter the first module with a temperature of about 800°C and subsequently, in said first phase (Ia) the rail skin is fast cooled down to a temperature of 350°C, - to obtain a pearlitic rail, the rail is controlled to enter the first module with a temperature in a range of about 850°C and subsequently, in said first phase (Ia) the rail skin is fast cooled down to a temperature of about 560°C by fast cooling means with a cooling rate comprised between 25°C/s to 45°C/s.