Emergency department (ED) overcrowding and long patient wait times have become a worldwide problem. We propose a novel approach to assign physicians to shifts such that ED wait times are reduced without adding new physicians. In particular, we extend the physician rostering problem by including the heterogeneity between emergency physicians with regard to their productivity levels (measured as patient-per-hour rate) and by including the stochastic nature of patient arrivals and physician productivity. We formulate the physician rostering problem as a two-stage stochastic program and solve it with a sample average approximation and the L-shaped method. To formulate the problem, we perform a data analysis to investigate the major drivers of physician productivity levels using patient visit data from our partner ED, and find that {individual physicians, shift hour, and shift type (e.g., day or night) are the dominating factors of ED productivity. A simulation study calibrated using real data shows that the new scheduling from our formulation can reduce patient wait times by as much as 16%, compared to the current scheduling at our study ED. We also demonstrate how to incorporate physician preference in scheduling through physician clustering based on their productivity levels. Our simulation results show that EDs can receive almost full benefit even when the number of clusters is fairly small.