We explore the use of instrumental variables (IV) analysis with a multisite randomized trial to estimate the effect of a mediating variable on an outcome. We use a random-coefficient IV model that allows both the impact of program assignment on the mediator (compliance with assignment) and the impact of the mediator on the outcome (the treatment effect) to vary across sites and to covary with one another. This extension of conventional fixed-coefficient IV analysis illuminates a potential bias in IV analysis, which Reardon and Raudenbush (forthcoming) refer to as "compliance-effect covariance bias." We first derive an expression for this bias and then use simulations to investigate the sampling variance of the conventional fixed-coefficient two-stage least squares (2SLS) estimator in the presence of varying (and covarying) compliance and treatment effects. We next develop an alternate IV estimator that is less susceptible to compliance-effect covariance bias. We compare the bias, sampling variance, and root mean squared error of this "bias-corrected IV estimator" with those of 2SLS and ordinary least squares (OLS). We find that when the first stage F-statistic exceeds 10 (a commonly used threshold for instrument strength), the bias-corrected estimator typically performs better than 2SLS or OLS. In the last part of the paper, we use both the new estimator and 2SLS to reanalyze data from two large multisite studies.