A method for automatically determining first-motion polarities is developed, with a view to its application to the focal mechanism analysis of massive microseismic events caused by hydraulic fracturing. The method is based on two assumptions: the existence of a point source, which has negligible effects of fault finiteness and rupture directivity; and a laterally homogeneous structure, which has azimuthally isotropic propagation characteristics. Under these assumptions, the event waveforms recorded at each station share a common source time function shape, with varying amplitudes, that is dependent on the radiation pattern from the source. With respect to the reference waveform with the highest signal-to-noise ratio (SNR) among all the waveforms at each station for an event, the relative polarities of waveforms at other stations are estimated using cross correlation analysis. The absolute polarities of each waveform are then defined using the reference waveform, whose SNR can be further enhanced using the stacked waveforms after corrections of relative polarities and time lags between the reference and target waveforms have been made. Then, a grid-search algorithm can be incorporated to invert focal mechanisms using the automatically measured polarities for a given event. Since the procedure requires only the evaluation of a cross-correlation coefficient, it can be incorporated into an automated algorithm. The method is applied to determine the focal mechanism solutions of microseismic events occurring in a shale gas play where commercial production is ongoing. Two types of focal mechanism solutions are found to be dominant: vertical dip-slip, and strike-slip. The strike-slip events occur due to re-activation of natural fractures connecting cracks opened by hydraulic fracturing. For the vertical dip-slip events, it was observed that their strikes are consistent with the direction of maximum horizontal stress, which supports the theory that slips occur on the horizontal bedding planes due to the opening of vertical cracks generated by hydraulic fracturing.