Spider-Man and the PS4 helped Sony make a surprise profit in the last three months. Between April and June, the Japanese giant made a net profit of 25.7bn yen (around $250m or £148m), but it's still set to make an overall loss for the year.
Announcing its first quarter financial results for the three months to 30 June, Sony boss Kaz Hirai admitted Sony still expects to make a loss of around 50 billion yen for the year.
Sony manufactures a wide range of technology from televisions to Xperia smartphones. Unusually among technology firms, Sony also creates the content enjoyed on the devices it sells, with a movie studio and record label. Movies such as this summer's "Amazing Spider-Man 2" and "22 Jump Street" boosted Sony's bottom line, but betting big on blockbusters can leave the company vulnerable to flops like last year's under-performing "After Earth."
"The Amazing Spider-Man 2" has earned Sony around $706M worldwide, while "22 Jump Street" is still raking in the cash in theatres around the globe.
Sony has also emerged as the leader in the race of next generation games consoles. The Sony PlayStation 4 went on sale in November 2013 and is outstripping the rival Xbox One from Microsoft and the Nintendo Wii U. In the most recent quarter, sales of the PS4 increased by 96 per cent.
That drove the games unit to an operating profit of 4.3bn yen in Q1, compared with an operating loss of 16.4bn yen during the same period last year.
"A 96 per cent gaming console division sales growth is impressive," says Professor Mark Skilton of Warwick Business School. This despite criticism levelled at Sony for failing to build "the integrated experience and multi-sided ecosystem that Google and Microsoft have developed in their gaming and wider diversification to web, ebooks and other media products."
"The lower value Japanese yen has helped Sony," notes Professor Skelton, but the results "still prove that a well-executed gaming platform priced competitively will perform well."
Sales of Bravia LCD televisions in Europe and Asia Pacific helped too, driven by this summer's World Cup.
Sony's results were also helped by cost-cutting measures such as selling off some buildings. This restructuring has been necessary after years of disastrous losses. Other measures to trim costs include ditching the part of the business that makes Vaio laptops, creating a separate company with the Vaio name.
Rival tech giant Samsung posted financial results this week too, showing a 25 percent drop in second-quarter operating profits. That's the third quarter of profit declines in a row thanks to stiff competition in the smartphone market.