Research and development (R&D) investment is very important for firms to gain competitive advantages and sustainable development. Due to the uncertainty of the market and competitors, R&D investment is usually costly and high risk. In such circumstances, firms not only have to figure out the optimal investment timing, but also consider whether to cooperate with competitors to share the risks and costs. In this paper, a two-stage dynamic exchange option game model is proposed for two symmetric competing firms to analyze their R&D investment decision and cooperation. The results show that under uncertainty, the R&D investment timing and cooperation strategy of the two firms depend on the market fluctuation, R&D cost, opportunity benefit of free riding, and the externality of cooperation. If the opportunity benefit of free riding is less than or equal to half of the cooperative research cost, the two firms will invest as early as possible and cooperate. The technology spillover and profits of new products will positively affect the willingness of the competing firms to invest and cooperate in R&D. Moreover, we also calculate the market value thresholds of the investment strategies for the two firms. When the market value is small, the two firms wait for the R&D investment; when the value increases, the firm with a high successful R&D probability will lead the investment, and the other firm follows the investment; when the value is large enough, the two firms will invest at the beginning of the period.