Lyme disease (LD) is the most common tick-borne illness in the United States. Although appropriate antibiotic treatment is effective for most cases, up to 20% of patients develop post-treatment Lyme disease syndrome (PTLDS). There is an urgent need to improve clinical management of LD using precise understanding of disease and patient stratification. We applied machine-learning to electronic medical records to better characterize the heterogeneity of LD and developed predictive models for identifying medications that are associated with risks of subsequent comorbidities. For broad disease categories, we identified 3, 16, and 17 comorbidities within 2, 5, and 10 years of diagnosis, respectively. At a higher resolution of ICD-9 codes, we identified known associations with LD including chronic pain and cognitive disorders, as well as particular comorbidities on a timescale that matched PTLDS symptomology. We identified 7, 30, and 35 medications associated with risks of these comorbidities within 2, 5, and 10 years, respectively. For instance, the first-line antibiotic doxycycline exhibited a consistently protective association for typical symptoms of LD, including backache. Our approach and findings may suggest new hypotheses for more personalized treatments regimens for LD patients.