Using methods from soft-collinear and heavy-quark effective theory, a systematic factorization analysis is performed for the (B) over bar -> X-s gamma photon spectrum in the endpoint region m(b)-2E(gamma) = O(Lambda(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 circle times S familiar from inclusive (B) over bar -> Xul (v) over bar decay distributions contains "resolved photon" contributions of the form H J circle times S circle times (J) over bar and H J circle times S circle times (J) over bar circle times (J) over bar Here S and (J) over bar 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 Q7(gamma) 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-gamma > 1.6GeV is estimated to be approximately +/- 5%. It could be reduced by an improved measurement of the isospin asymmetry Delta(0-) to the level of +/- 4%. We see no possibility to reduce this uncertainty further using reliable theoretical methods.