Results are presented of a search for heavy particles decaying into two photons. The analysis is based on a 19.7fb-1 sample of proton-proton collisions at s=8TeV collected with the CMS detector at the CERN LHC. The diphoton mass spectrum from 150 to 850GeV is used to search for an excess of events over the background. The search is extended to new resonances with natural widths of up to 10% of the mass value. No evidence for new particle production is observed and limits at 95% confidence level on the production cross section times branching fraction to diphotons are determined. These limits are interpreted in terms of two-Higgs-doublet model parameters. © 2015 CERN for the benefit of the CMS Collaboration.