If your lungs hurt that much then you were not ready for the effort when the pack dropped the hammer. A better warm-up could have helped your lungs and possibly your legs. That and getting used to ride hard in cooler/cold weather. Sucking in cold air can make your chest rattle for days.