が is a conjunctive particle that is used to join two sentences which express contrastive ideas in a single sentence. The meaning is the same as しかし(but; however).
この みちは せまいですが、あんぜんです。
This street is narrow, but it's safe.
Lesson 5-12「しんかんせんは はやいです。しかし、たかいです。」
Shinkansen is fast. However, it is expensive.
While しかし is used at the beginning of a sentence, が is used within a sentence.