An algorithm for risk-based optimization (RO) of engineering systems is proposed, which couples the Cross-entropy (CE) optimization method with the Line Sampling (LS) reliability method. The CE-LS algorithm relies on the CE method to optimize the total cost of a system that is composed of the design and operation cost (e.g., production cost) and the expected failure cost (i.e., failure risk). Guided by the random search of the CE method, the algorithm proceeds iteratively to update a set of random search distributions such that the optimal or near-optimal solution is likely to occur. The LS-based failure probability estimates are required to evaluate the failure risk. Throughout the optimization process, the coupling relies on a local weighted average approximation of the probability of failure to reduce the computational demands associated with RO. As the CE-LS algorithm proceeds to locate a region of design parameters with near-optimal solutions, the local weighted average approximation of the probability of failure is refined. The adaptive refinement procedure is repeatedly applied until convergence criteria with respect to both the optimization and the approximation of the failure probability are satisfied. The performance of the proposed optimization heuristic is examined empirically on several RO problems, including the design of a monopile foundation for offshore wind turbines.