On 19 October 2014, Mars experienced a close encounter with Comet C/2013 A1 Siding Spring.Using data from the Mars Advanced Radar for Subsurface and Ionosphere Sounding (MARSIS) on board Mars Express (MEX), we assess the interaction of the Martian ionosphere with the comet's coma and possibly magnetic tail during the orbit of their closest approach. The topside ionospheric electron density profile is evaluated from the altitude of the peak density of the ionosphere up to the MEX altitude. We find complex and rapid variability in the ionospheric profile along the MEX orbit, not seen even after the impact of a large coronal mass ejection. Before closest approach, large electron density reductions predominate, which could be caused either by comet water damping or comet magnetic field interactions. After closest approach, a substantial electron density rise predominates. Moreover, several extra topside layers are visible along the whole orbit at different altitudes, which could be related to different processes as we discuss.