TOKYO—Sony Corp. lost the smartphone war but rings up a sale on every shipment of Apple Inc.’s new iPhone 6 or Samsung Electronics Co.’s Galaxy S6.

The Japanese company is the world’s largest supplier of image sensors in digital cameras. To meet surging demand, Sony plans to invest $375 million in its image-sensor factories on top of nearly $900 million announced earlier this year.

“Whether...