The exploration of the planet Mars still is a top priority in planetary science because of the Earth-like character of Mars in the past and possibility it may have hosted microbial life when liquid water abounded on its surface. The surfaces of Mars are extensively covered with soil-like material and rocks of various sizes. Current wheeled rovers on Mars have been occasionally experiencing immobilization instances in unexpectedly weak terrain. The development of Mars rovers adaptable to these terrains is instrumental in improving exploration efficiency and expanding investigation scope. Many desert animals exhibit excellent traversal abilities on both granular media and rocky terrains. Inspired by moving mechanisms of the desert lizard, a biomimetic quadruped robot with structures of flexible active spine and toes was designed. Gait planning accounts for spine motion in coordination to foot movements. Three gaits of tripod, trot and turning are adopted by the robot and the motions are conceptually and numerically analyzed. On the soil and rocky terrains analog to Martian surface, the gasping force by the flexible toes are estimated, and field tests for assessing traversal abilities of the robot have been conducted. The traversing abilities by the field tests conclude that this biomimetic robot can adapt to Martian surface terrain.