Using methods from soft-collinear and heavy-quark effective theory, a systematic factorization analysis is performed for theB → X s γ photon spectrum in the endpoint region m b − 2E γ = O(Λ QCD ). It is proposed that, to all orders in 1/m b , the spectrum obeys a novel factorization formula, which besides terms with the structure H J ⊗ S familiar from inclusiveB → X u lν decay distributions contains "resolved photon" contributions of the form H J ⊗ S ⊗J and H J ⊗ S ⊗J ⊗J. Here S andJ are new soft and jet functions, whose form is derived. These contributions arise whenever the photon couples to light partons instead of coupling directly to the effective weak interaction. The new contributions appear first at order 1/m b and are related to operators other than Q 7γ in the effective weak Hamiltonian. They give rise to non-vanishing 1/m b corrections to the total decay rate, which cannot be described using a local operator product expansion. A systematic analysis of these effects is performed at tree level in hard and hard-collinear interactions. The resulting uncertainty on the decay rate defined with a cut E γ > 1.6 GeV is estimated to be approximately ±5%. It could be reduced by an improved measurement of the isospin asymmetry ∆ 0− to the level of ±4%. We see no possibility to reduce this uncertainty further using reliable theoretical methods.