Introduction Illness perception and self-efficacy in patients with coronary artery disease (CAD) may affect medication adherence, which is one of the most important challenges in disease management in this group of patients. Objective The present study aimed to investigate the factors influencing medication adherence in CAD patients, especially the effect of illness perception and self-efficacy. Methods This study was cross-sectional and conducted from April to September 2021. A total of 259 patients with confirmed CAD were selected by convenience sampling method based on inclusion criteria. Illness perception, self-efficacy, and medication adherence were investigated using Brief IPQ, SCSES, and MARS_10 questionnaires, respectively. The data were analyzed using the STATA software (version 14) and the regression path analysis method. Results Patients had moderate illness perception and high self-efficacy, and 61.8 of them adhered to their medication regimen. Greater illness perception, better self-efficacy, and higher education had a positive effect on medication adherence, and increasing age had a negative effect on it. The final path model shows a good fit of the data in the model (χ2: 0.37, df: 274, χ2/df: 0.36, CFI: 1, IFI: 0.95, TLI: 1.07, and RMSEA: 0.00). Conclusion The results of the present study suggest that patients’ illness perception can play an important role in predicting self-efficacy in disease management and the level of medication adherence in patients with CAD. To improve self-efficacy and medication adherence, future intervention studies should focus on the patient's illness perceptions and their improvement.