In ITER, reflection of photons on vacuum vessel will make parasitic signals (stray light) for optical diagnostics. In this study, to estimate and mitigate the effect of the stray light in ITER in a systematic manner, a ray transfer matrix was constructed based on ray tracing calculations for a divertor impurity monitor and charge-exchange recombination spectroscopy (CXRS). It is shown that the allocation of the sources around the strike point and the X-point, where the emission is strong, is important for the model used to build the transfer matrix to effectively mitigate the stray light. The origin of the stray light for the core CXRS is investigated, and a case study to subtract the stray light is shown.