I'm making some fun magical items and one of the effects is that it can cast a 2nd level spell, scorching ray, and the spell description says, "Make a ranged spell attack for each ray." But what if a non-spell-casting character uses the item, what would the spellcasting ability modifier be?
Some examples of magic items that accomplish similar things:
Spell Scrolls: each spell level has a given rarity, save DC, and attack bonus. The attack bonuses progress from cantrips to 9th-level as +5, +5, +5, +7, +7, +9, +9, +10, +10, +11.
Circlet of Blasting: Casts Scorching Ray with an attack bonus of +5.
Ioun Stone of Reserve: Casts stored spells with the attack bonus of the caster who stored it.
Quaal's Feather Token (Whip): Makes spell attacks with an attack bonus of +9.
Ring of Spell Storing: casts using the attack bonus of the person who stored the spell.
Ring of Spell Turning: When it reverses a spell, it uses the attack bonus of the original caster.
Staff of Power: When casting its spells, the user's save DC or attack bonus are used. Note that this item is restricted to use by certain spellcasting classes. This also occurs with...
Wand of Paralysis: Makes a spell attack using the user's bonus. Also only usable by a spellcaster.
So the first thing you need to consider is whether your item is restricted to spellcasters or not. If it is, you will probably be using the spell attack bonus of the user. If it is not restricted, the trend seems to be to assign a specific attack bonus to it, which seems to increase with the rarity of the item. If it is not restricted, the second step is then to decide what rarity you would like the item to be, which is best cross-referenced with the spell scroll table to find an appropriate spell attack bonus or DC.
While the other answers thoroughly deal with the options you have for setting a fixed DC for the item, I will provide an answer to your question.
What is the spellcasting ability modifier for a non-spellcaster character?
The rules on this can be found in the DMG, in the Magic Items (Activating an Item) section:
Spells (DMG, p.141)
A magic item, such as certain staffs, may require you to use your own spellcasting ability when you cast a spell from the item. If you have more than one spellcasting ability, you choose which one to use with the item. If you don't have a spellcasting ability - perhaps you're a rogue with the Use Magic Device feature - your spellcasting ability modifier is +0 for the item, and your proficiency bonus does apply.
A spellcasting ability modifier is given as a specific class ability. So as long as the character using the item has no levels in a spellcaster class, this modifier is +0. Therefore, spell attacks and saves should include only the proficiency bonus, which is based solely on the (total) character level.