The correct option is
A The, a, the
The indefinite articles 'a' and 'an' are used to modify a non-specific or non-particular noun. The article 'a' precedes a noun which begins with a consonant sound and the article 'an' precedes a noun which begins with a vowel sound. The definite article 'the' is used to modify a specific or particular noun. In the given sentence, the noun phrase, 'king of Scotland' refers to a particular person as there can be only one king of Scotland. Hence, this phrase should be preceded by the definite article 'the'. In both options A and D, this phrase is preceded by the definite article, 'the', which is correct.
Option B indicates the use of the article, 'a' before this noun phrase. Option C indicates the use of no article before this noun phrase. Hence, these two options are incorrect.
The word, 'spider' is a common noun. In the given sentence, it does not refer to any specific spider. Hence, an indefinite article ('a' or 'an') is to be used before this word. As the word, 'spider' starts with a consonant sound, the article 'a' is to be used before it. In both options A and D, this is correctly indicated.
The word cave is preceded by the definite article 'the'. Hence, we know that it refers to a specific cave. The ceiling of such a specific cave should also refer to a specific ceiling. Hence, the noun phrase, 'ceiling of the cave' should be preceded by the definite article, 'the'. Option A indicates this correctly and is the correct answer.
Option D indicates use of no article before the noun phrase, 'ceiling of the cave'. Hence, this option is incorrect.