eToys, a Santa Monica-based online toy retailer, has agreed to buy its main rival, Pasadena-based Toys.com, for an undisclosed amount of cash and stock, company officials said. The addition of Toys.com will boost eToys' customer base by 35%, said Phil Polishook, vice president of marketing at eToys. Both companies are privately held. Polishook said the purpose of the deal is to boost eToys' ability to compete against Toys R Us, which plans to launch a Web-based shopping service later this year. The acquisition will include Toys.com's inventory, Web address, and marketing agreements with America Online and with Web search sites Yahoo, Infoseek, Excite and Lycos. The sale will allow Web Magic, which produced Toys.com, to develop other online commerce businesses, Chief Executive Greg McLemore said.