In fa-idhā, fa connects the instruction to what precedes, and idhā introduces the time condition. Zālat is a past-form verb from z-w-l, here meaning 'passed the meridian'; its tāʾ agrees with the feminine sun.
Al-shamsu is the nominative subject. Ramā is the past-form verb describing the rite; its implied subject is the pilgrim, and al-jimāra al-thalāth is the object of the stoning.