Path planning and collision avoidance are common problems for researchers in vehicle and robotics engineering design. In the case of autonomous ships, the navigation is guided by the regulations for preventing collisions at sea (COLREGs). However, COLREGs do not provide specific guidance for collision avoidance, especially for multi-ship encounters, which is a challenging task even for humans. In short-range path planning and collision avoidance problems, the motion of target ships is often considered as moving at a constant velocity and direction, which cannot be assumed in long-range planning and complex environments. The research challenge here is how to factor in the uncertainty of the motion of the target ships when making long-range path plans. In this paper, we introduce a long-range path planning algorithm for autonomous ships navigating in complex and dynamic environments to reduce the risk of encountering other ships during future motion. Based on the information on the position, speed over ground, and course over ground of other ships, our algorithm can estimate their intentions and future motions based on the probabilistic roadmap algorithm and use a risk-aware A* algorithm to find the optimal path that has low accumulated risk of encountering other ships. A case study is carried out on real automatic identification systems (AIS) datasets. The result shows that our algorithm can help reduce multi-ship encounters in long-term path planning.