بِمَصَابِيحَ — bare indefinite diptote: genitive fatḥa.
بِالْمَصَابِيحِ — with al-: genitive kasra.
بِمَصَابِيحِ الْمَسْجِدِ — in iḍāfa: genitive kasra.
All three are genitive. The ending differs because of the definite article or the construct relationship.