Wal-Mart Stores Inc is accelerating its investment in e-commerce in a bid to narrow the gap with Amazon.com Inc.