The phenomenon that the beginning of the first consonant of the latter component of a compound word is often altered as k→g, s→z, t→d, and h→b (sometimes h→p) is called rendaku (連濁). I explained it a little in another answer, but here is a more detailed explanation.
There are no firm rules to tell when it happens completely. However, as the Wikipedia article explains, there are some general rules which almost always apply. Below is some of these rules:
- Most Sino-Japanese words tends to resist rendaku. 保安 (ほあん; safety-keeping) + 検査 (けんさ; inspection) = 保安検査 (ほあんけんさ; safety inspection), not ほあんげんさ. (But some words accept rendaku. 株式 (かぶしき; stock) + 会社 (かいしゃ; company) = 株式会社 (かぶしきがいしゃ; roughly corresponds to “business corporation”).)
- If the latter component is a gairaigo, rendaku does not occur. アイス + コーヒー = アイスコーヒー, not アイスゴーヒー.
- If the latter component already contains a voiced consonant, the word usually resists rendaku. 山 (やま; mountain) + 火事 (かじ; fire) = 山火事 (やまかじ; mountain fire), not やまがじ.
- If the compound word of A and B means “A and B” (as opposed to “B of A” and so on), the word usually resists rendaku. 山 (やま; mountain) + 川 (かわ; river, stream) becomes 山川 (やまがわ) when it means a stream in a mountain and 山川 (やまかわ) when it means mountains and rivers.
- If the latter component is already a compound word, the word usually resists rendaku. 紋 (もん; crest) + シロチョウ (literally “white butterfly”; meaning Pieridae) = モンシロチョウ (literally “white butterfly with crest”; meaning Pieris rapae), not モンジロチョウ.
蕎麦 (そば; soba; buckwheat noodles) resists rendaku because of the third bullet.
I do not think that 恋心 (こいごころ) and 真心 (まごころ) are ever read as こいこころ or まこころ.
The only word 美空 (みそら) that I know is the stage name of the singer 美空ひばり. I do not know why it is not みぞら, but I will not be surprised if a name (especially an invented name) does not follow the regular pattern, and the “regular” pattern is not very regular after all.
用心 and 欲心 are not really compound words because 心 (しん) is not a word on its own. I do not know if the fact that 用心 is read as ようじん instead of ようしん is also categorized as rendaku or not, and I do not know if there is any explanation when it happens.