This paper presents closed-form solutions for the investment and valuation of a competitive firm with a Cobb-Douglas production function and a constant elasticity adjustment cost function in the presence of stochastic prices for output and inputs. The value of the firm is a linear function of the capital stock. The optimal rate of investmentis an increasing function of the slope of the value function with respect to the capital stock (marginal q). A mean preserving spread of the distribution of future price increases investment. An increase in the scale of the random component of a price can increase, decrease or not affect the rate of investment depending on the sign of the covariance of this price with a weighted average of all prices.