Background: Smoking and alcohol use have been associated with common genetic variants in multiple loci. Rare variants within these loci hold promise in the identification of biological mechanisms in substance use. Exome arrays and genotype imputation can now efficiently genotype rare nonsynonymous and loss of function variants. Such variants are expected to have deleterious functional consequences and to contribute to disease risk. Methods: We analyzed ∼250,000 rare variants from 16 independent studies genotyped with exome arrays and augmented this dataset with imputed data from the UK Biobank. Associations were tested for five phenotypes: cigarettes per day, pack-years, smoking initiation, age of smoking initiation, and alcoholic drinks per week. We conducted stratified heritability analyses, single-variant tests, and gene-based burden tests of nonsynonymous/loss-of-function coding variants. We performed a novel fine-mapping analysis to winnow the number of putative causal variants within associated loci. Results: Meta-analytic sample sizes ranged from 152,348 to 433,216, depending on the phenotype. Rare coding variation explained 1.1% to 2.2% of phenotypic variance, reflecting 11% to 18% of the total single nucleotide polymorphism heritability of these phenotypes. We identified 171 genome-wide associated loci across all phenotypes. Fine mapping identified putative causal variants with double base-pair resolution at 24 of these loci, and between three and 10 variants for 65 loci. Twenty loci contained rare coding variants in the 95% credible intervals. Conclusions: Rare coding variation significantly contributes to the heritability of smoking and alcohol use. Fine-mapping genome-wide association study loci identifies specific variants contributing to the biological etiology of substance use behavior.