Many spells allow creatures to defend themselves using either their AC or a saving throw. Two statistics govern how potent your spells are against these defenses: your spell attack roll and your spell DC. When recording these on your character sheet, add together only the numbers that always apply—usually just your ability modifier and proficiency bonus.
Spell attack roll = your spellcasting ability modifier + proficiency bonus + other bonuses + penalties
Spell DC = 10 + your spellcasting ability modifier + proficiency bonus + other bonuses + penalties
A spell attack roll is like other attack rolls, so any bonuses or penalties that apply to all your attack rolls should be included in your calculation. For instance, the +1 status bonus from the Bless spell would benefit your spell ray just like it could an arrow. However, note that the spell attack roll doesn’t gain any bonuses or penalties that apply specifically to weapon attacks or unarmed attacks. The multiple attack penalty applies to spell attacks, so it’s usually a bad idea to cast a spell that has a spell attack roll if you’ve already made an attack that turn.
As with other checks and DCs, bonuses can increase the result of your spell attack roll or your spell DC, and penalties can decrease the result of your spell attack roll or your spell DC.