Photospheric (thermal) emission is inherent to the gamma-ray burst (GRB) "fireball" model. We show that inclusion of this component in the analysis of the GRB prompt emission phase naturally explains some of the prompt GRB spectra seen by the Fermi satellite over its entire energy band. The sub-MeV peak is explained as multi-color black body emission, and the high energy tail, extending up to the GeV band, results from roughly similar contributions of synchrotron emission, synchrotron self Compton (SSC) and Comptonization of the thermal photons by energetic electrons originating after dissipation of the kinetic energy above the photosphere. We briefly discuss the theory of multicolor black body emission from relativistically expanding plasma, before showing how the analysis method proposed results in a complete, self consistent picture of the physical conditions at both emission sites of the thermal and non-thermal radiation. Furthermore, it enables to extract the values of the free model parameters. We demonstrate the analysis method on GRB090902B, and present the values of the physical parameters deduced. We briefly discuss the uniqueness of GRB090902B-type spectra.