Your leg soreness is due to muscle damage, not lactic acid. When you get back on your bike and feel the pain early, your body is telling you to back off and not continue to put more injury into your muscles. At that point, best thing to do is slow way down, use an easy gear and spin gently. After a few days, maybe up to a week if you've really put the hurt on yourself, your legs will recover.
Recovery is just as important as training load. You'll need good nutrition and lots of rest for optimum recovery. Not just days off the bike, but real rest with your legs up as well as lots of sleep. The TdF pro's maximize their recovery with a massage and nutrition at the end of the day's race, followed by as much rest and sleep as they can get.
In my opinion, to many self-coached cyclists train too hard, too often, thinking that "more is better". If you're relatively new to cycling, suggest you should restrict your harder rides to just once or twice a week, and only when you feel good enough to put in quality efforts. After many thousand of miles/hours on the bike, you'll be able to tolerate and progress on more hard training, but until then, learn to take it easy on your rides. You don't have to endure the pain of overtraining to make progress, and you'll enjoy the miles a lot more.
Real progress in cycling takes time. Despite popular training books like "Seven weeks to your Perfect Ride", there are no real "magic bullets" to overnight success. Enjoy your riding, and let progress come to you over months and seasons of riding.