We develop a stochastic, general equilibrium, two-country model of trade and macroeconomic dynamics. Productivity differs across individual, monopolistically competitive firms in each country. Firms face a sunk entry cost in the domestic market and both fixed and per-unit export costs. Only relatively more productive firms export. Exogenous shocks to aggregate productivity and entry or trade costs induce firms to enter and exit both their domestic and export markets, thus altering the composition of consumption baskets across countries over time. In a world of flexible prices, our model generates endogenously persistent deviations from PPP that would not exist absent our microeconomic structure with heterogeneous firms. It provides an endogenous, microfounded explanation for a Harrod-Balassa-Samuelson effect in response to aggregate productivity differentials and deregulation. Finally, the model successfully matches several moments of U.S. and international business cycles.