The main aim of the longitudinal study was to investigate the effect of both the cognitive sphere (i.e. self-appraisal of health) and affective state (i.e. anxiety and hope) on meaning in life as perceived by chronically ill patients. The rationale of the study was the theory of meaningfulness of suffering by V. E. Frankl. Participants were 181 patients with either arterial hypertension or neoplasms with bad prognosis, examined thrice: up to 10 days since the diagnosis (stage I), about 5 weeks from the diagnosis (stage II) and at a follow-up about 5 months since stage II (stage III). Multiple regression analysis revealed a statistically significant effect of both the cognitive and affective sphere on the patients' spirituality, irrespective of the type of illness and stage of the study.