The comparison is in 苏轼's quatrain on drinking by the lake as the sun gives way to rain: 欲把西湖比西子,淡妆浓抹总相宜 'I would liken West Lake to Xizi: in light make-up or heavy, she always looks right'. Ever since, West Lake has also been called 西子湖.
usage
西子 is the literary form of the name; in everyday speech she is 西施, as in the saying that a lover's eyes see Xi Shi, 情人眼里出西施.