To survive in today's competitive market, it is not enough to produce low-cost products but also quality-related issues and lead time needs to be considered in the decision-making process. This paper extends the previous research by developing a stochastic economic manufacturing quantity (EMQ) model for a production system which is subject to process shifts from an incontrol state to an out-of-control state at any random time. Moreover, we consider the option of investment to increase the process quality and decrease the lead-time variability. Closed-form solutions of the proposed models are obtained by applying the classical optimization technique. Some lemmas and theorems are developed to determine the optimal solution of the decision variables. Numerical results are obtained for each of these models and compared with those of the basic EMQ model without any investment. From the numerical analysis, it has been observed that our proposed model can significantly reduce the cost of the system compared to the basic model.