There is a well-established socioeconomic gradient in smoking behavior: those with lower socioeconomic status smoke more. However, much less is known about the mechanisms explaining how SES is linked to smoking. This study takes a social-ecological perspective by examining whether socioeconomic status affects smoking behavior by differential exposure to places where smoking is allowed. Exposure to smoking restrictions was assessed in real-time using Ecological Momentary Assessment methods. A sample of 194 daily smokers, who were not attempting to quit, recorded their smoking and information about situational and contextual factors for three weeks using an electronic diary. We tested whether a smoker's momentary context mediated the relationship between socioeconomic status (educational attainment) and cigarettes smoked per day (CPD). Momentary context was operationalized as the proportion of random assessments answered in locations where smoking was allowed versus where smoking was not allowed. Data were analysed using multilevel regression (measurements nested within participants) with a lower level mediation model (2-1-1 mediation). Although no significant direct effect of SES on CPD were observed, there was a significant indirect effect of SES on CPD via the momentary context. Compared to participants with higher education, lower educated participants were more likely to encounter places where smoking was allowed, and this in turn, was associated with a higher number of CPD. These findings suggest that SES is associated with smoking at least partially via differential exposure to smoking-friendly environments, with smokers from lower SES backgrounds accessing more places where smoking is allowed. Implications for current smoke-free legislation are discussed.