The rainy and foggy weather causes the increasing traffic accident and decreasing traffic capacity. In this paper, a variable speed limit control strategy in rainy and foggy weather is proposed by taking the traffic safety and traffic efficiency into consideration. Firstly, considering the influence of road alignment on vehicle speed and road capacity in rainy and foggy weather, the dynamic traffic flow model is established. Then, the maximum safe speed is determined according to drivers" visual distance, road adhesion coefficient and road curve. Finally, adaptive genetic algorithm is used to solve the objective function including total travel time and total mileage, and the speed limit value of each section in rainy and foggy weather is obtained. The simulation results show that the proposed variable speed limit strategy can effectively reduce the traffic risk and traffic congestion in rainy and foggy weather.