The Yamaha Factory Racing rider's time of one minute 33.929 seconds left him 0.076secs clear of Casey Stoner, whose Repsol Honda team-mate Dani Pedrosa was third fastest.
Lorenzo was a second adrift of Stoner in sixth after free practice one, but was upbeat after his improvement in the afternoon.
"I feel much more comfortable on the bike this afternoon with the changes we made," said Lorenzo.
"The setting we made is very similar to the Mugello one and there I won the race.
"To be honest I didn't expect so much change because we improved more than one second. We are now quite close to a victory I think. Casey and Dani are still so fast but at least we are there with them."
San Carlo Honda's Marco Simoncelli also endured a difficult morning session but knocked more than half a second off his time in session two, his best effort of 1:34.444 the fourth fastest of the day.
Lorenzo's team-mate Ben Spies' time of 1:34.469 from the first session placed the American fifth ahead of Repsol Honda's Andrea Dovizioso.
Spies was the only rider not to improve in session two and said: "Not bad today, it wasn't a great second session but we had to try a lot of things.
"Overall a positive day, we tried some stuff that worked and some stuff that didn't. We need to work harder for tomorrow and improve some grip levels but the overall feel and speed I'm happy with."
Valentino Rossi was back in 11th, one place ahead of Randy de Puniet, and Nicky Hayden (13th) and Cal Crutchlow (16th) also struggled to make an impression.