On the responses to solar X‐ray flare and coronal mass ejection in the ionospheres of Mars and Earth