In recent years, growth in the demand for emergency medical services, along with decline in the number of hospitals with emergency departments (EDs), has raised concerns about the ability of the EDs to provide adequate service. Many EDs frequently report periods of overcrowding during which they are forced to divert incoming ambulances to neighboring hospitals, a phenomenon known as "ambulance diversion." The objective of this paper is to study the impact of key operational characteristics of the hospitals such as the number of ED beds, the number of inpatient beds, and the utilization of inpatient beds on the extent to which hospitals go on ambulance diversion. We propose a simple queueing network model to describe the patient flow between the ED and the inpatient department. We analyze this network using two different approximations-diffusion and fluid-to derive two separate sets of measures for inpatient occupancy and ED size. We use these sets of measures to form hypotheses and test them by estimating a sample selection model using data on a cross section of hospitals from California. We find that the measures derived from the diffusion approximation provide better explanation of the data than those derived from the fluid approximation. For this model, we find that the fraction of time that the ED spends on diversion is decreasing in the spare capacity of the inpatient department and in the size of the ED, where both are appropriately normalized for the size of the inpatient department. In addition, controlling for these hospital-specific factors, we find that the fraction of time on diversion at a hospital increases with the number of hospitals in its neighborhood. We also find that certain hospitals, owing to their location, ownership, and trauma center status, are more likely to choose ambulance diversion to mitigate overcrowding than others.