The derailleur system on bicycle can makes riders time-saving or labor-saving by changing the suitable reduction ratio. The rear derailleur should guide the running chain rapidly and precisely to a selected freewheel sprocket position without disengagement from the freewheel assembly. Therefore, the design of the rear derailleurs has a great influence on the shifting process. In this study, a mathematical model of a four-bar linkage mechanism in a spatial rear derailleur is developed to simulate cable force and the displacement of the guide pulley in shifting direction. The relation between cable force and displacement is obtained and verified. And, it can be found that friction between cable and adjusting screw unit is a key factor. Then, we use the mathematical model to optimize the cable force. By changing the position of couple point, we can reduce not only the maximum cable force 9.26% but also the difference force betwee the maximum and minimum cable force 65.49%. Finally, a roller design to replace the adjusting screw to reduce the friction force is proposed.